From 08ae10eaef55edb58597a7ccd79ee518022e2daa Mon Sep 17 00:00:00 2001 From: uttam282005 Date: Thu, 22 Jan 2026 17:58:02 +0530 Subject: [PATCH 1/3] Add directory mode and archive discovery Signed-off-by: uttam282005 --- etc/release/scancode_release_tests.py | 52 +++++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/etc/release/scancode_release_tests.py b/etc/release/scancode_release_tests.py index 5b641bd28a2..b1602633ebb 100755 --- a/etc/release/scancode_release_tests.py +++ b/etc/release/scancode_release_tests.py @@ -11,12 +11,35 @@ import os import shutil +import glob import subprocess import sys on_windows = "win32" in str(sys.platform).lower() +def find_app_archives(directory: str): + """ + Find all application archives in the given directory. + Supported formats: + - .tar.gz + - .zip + """ + if not os.path.isdir(directory): + print(f"Directory does not exist: {directory}") + + patterns = ("*.tar.gz", "*.zip") + + archives = [] + for pattern in patterns: + archives.extend(glob.glob(os.path.join(directory, pattern))) + + if not archives: + print(f"No app archives found in {directory}") + sys.exit(1) + + return archives + def run_app_smoke_tests(app_archive): """ Run basic "smoke" scancode tests for the app release archive `app_archive` @@ -112,8 +135,31 @@ def run_command(args): print(cpe.output) sys.exit(128) +def main(): + args = sys.argv[1:] + + if not args: + print("ERROR: No arguments provided") + print("Usage:") + print(" python scancode_release_tests.py ") + print(" python scancode_release_tests.py --directory ") + sys.exit(1) + + if args[0] == "--directory": + if len(args) < 2: + print("--directory flag requires a directory path") + sys.exit(1) + directory = args[1] + if not os.path.isdir(directory): + print(f"Directory does not exist: {directory}") + sys.exit(1) + + archives = find_app_archives(directory) + for archive in archives: + run_app_smoke_tests(archive) + else: + archive = args[0] + run_app_smoke_tests(archive) if __name__ == "__main__": - args = sys.argv[1:] - archive = args[0] - run_app_smoke_tests(archive) + main() From 7aae46efa861caa22879f16555e245af79e747c3 Mon Sep 17 00:00:00 2001 From: uttam282005 Date: Thu, 22 Jan 2026 17:58:57 +0530 Subject: [PATCH 2/3] Removing unziping app archives in CI Signed-off-by: uttam282005 --- .github/workflows/scancode-release.yml | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) diff --git a/.github/workflows/scancode-release.yml b/.github/workflows/scancode-release.yml index b8bbf9077ee..c8b5f8d609f 100644 --- a/.github/workflows/scancode-release.yml +++ b/.github/workflows/scancode-release.yml @@ -348,15 +348,7 @@ jobs: path: dist - name: test install app archive - run: | - for f in `find dist -type f -name "*.zip"`; \ - do \ - unzip file.zip $f; \ - done - for f in `find dist -type f -name "*.tar.gz"`; \ - do \ - python etc/release/scancode_release_tests.py $f; \ - done + run: python etc/release/scancode_release_tests.py --directory dist smoke_test_install_and_run_app_archives_on_macos: @@ -393,15 +385,7 @@ jobs: path: dist - name: test install app archive - run: | - for f in `find dist -type f -name "*.zip"`; \ - do \ - unzip file.zip $f; \ - done - for f in `find dist -type f -name "*.tar.gz"`; \ - do \ - python etc/release/scancode_release_tests.py $f; \ - done + run: python etc/release/scancode_release_tests.py --directory dist smoke_test_install_and_run_app_archives_on_windows: @@ -438,8 +422,7 @@ jobs: path: dist - name: test install app archive - run: | - for %%F in (dist/*.zip) do python etc/release/scancode_release_tests.py dist/%%F + run: python etc/release/scancode_release_tests.py --directory dist publish_to_gh_release: permissions: From 9e8830b16837cec6394c33bcf7ab5b9b8a16b529 Mon Sep 17 00:00:00 2001 From: uttam282005 Date: Thu, 22 Jan 2026 20:53:20 +0530 Subject: [PATCH 3/3] chore: trigger ci Signed-off-by: uttam282005