From 4cfa6455c732b2728ab810b0e7a5e54419c2a7c3 Mon Sep 17 00:00:00 2001 From: Patrick Robertson Date: Wed, 26 Mar 2025 15:07:57 +0400 Subject: [PATCH 1/3] Only make the downloads action run if the core action was successful --- .github/workflows/tests-download.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests-download.yaml b/.github/workflows/tests-download.yaml index a68231f..786b63d 100644 --- a/.github/workflows/tests-download.yaml +++ b/.github/workflows/tests-download.yaml @@ -1,15 +1,23 @@ name: Download Tests on: + # Schedule this workflow to run every Monday at 14:35 UTC schedule: - cron: '35 14 * * 1' - pull_request: - branches: [ main ] + + # For PRs, run the tests-core workflow first + workflow_run: + workflows: ["Core Tests"] # This should match the name of your tests-core workflow + types: + - completed + branches: [main] paths: - src/** jobs: tests: + # Only run if the triggering workflow (tests-core) succeeded + if: ${{ github.event_name == 'schedule' || github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-22.04 strategy: fail-fast: false @@ -21,6 +29,9 @@ jobs: steps: - uses: actions/checkout@v4 + with: + # When triggered by workflow_run, we need to check out the PR code + ref: ${{ github.event.workflow_run.head_branch || github.ref }} - name: Install poetry run: pipx install poetry From e9ee4d67baf95de5b0e91f6e4f150c2aecd7a2fc Mon Sep 17 00:00:00 2001 From: Patrick Robertson Date: Wed, 26 Mar 2025 15:09:24 +0400 Subject: [PATCH 2/3] Re-add 'ubuntu-latest' - now that we're rid of tsp_client --- .github/workflows/tests-core.yaml | 3 +-- .github/workflows/tests-download.yaml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests-core.yaml b/.github/workflows/tests-core.yaml index 57028bd..c839249 100644 --- a/.github/workflows/tests-core.yaml +++ b/.github/workflows/tests-core.yaml @@ -20,8 +20,7 @@ jobs: fail-fast: false matrix: python-version: ["3.10", "3.11", "3.12"] - os: [ubuntu-22.04] - #TODO: re-enable ubuntu-latest, this is disabled as oscrypto cannot be pinned to github commit and pushed to pypi + os: [ubuntu-22.04, ubuntu-latest] defaults: run: working-directory: ./ diff --git a/.github/workflows/tests-download.yaml b/.github/workflows/tests-download.yaml index 786b63d..a8337cf 100644 --- a/.github/workflows/tests-download.yaml +++ b/.github/workflows/tests-download.yaml @@ -7,7 +7,7 @@ on: # For PRs, run the tests-core workflow first workflow_run: - workflows: ["Core Tests"] # This should match the name of your tests-core workflow + workflows: ["Core Tests"] types: - completed branches: [main] @@ -30,7 +30,6 @@ jobs: steps: - uses: actions/checkout@v4 with: - # When triggered by workflow_run, we need to check out the PR code ref: ${{ github.event.workflow_run.head_branch || github.ref }} - name: Install poetry From 76e90dd23a81c54f1eb5ddcd30cf85064eaecb88 Mon Sep 17 00:00:00 2001 From: Patrick Robertson Date: Wed, 26 Mar 2025 15:34:33 +0400 Subject: [PATCH 3/3] Small code tidy ups --- src/auto_archiver/core/module.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/auto_archiver/core/module.py b/src/auto_archiver/core/module.py index 3fdc3ae..1494fd6 100644 --- a/src/auto_archiver/core/module.py +++ b/src/auto_archiver/core/module.py @@ -214,11 +214,8 @@ class LazyBaseModule: # check external dependencies are installed def check_deps(deps, check): - for dep in deps: - if not len(dep): - # clear out any empty strings that a user may have erroneously added - continue - if not check(dep): + for dep in filter(lambda d: len(d.strip()), deps): + if not check(dep.strip()): logger.error( f"Module '{self.name}' requires external dependency '{dep}' which is not available/setup. \ Have you installed the required dependencies for the '{self.name}' module? See the documentation for more information."