From 744680829f3d41e81b4131582a60b81114bf401b Mon Sep 17 00:00:00 2001 From: Edmund Miller Date: Thu, 2 Nov 2023 13:54:56 -0500 Subject: [PATCH] ci: One changes job to rule them all --- .github/workflows/test.yml | 57 ++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e9b40ba30fb7..efbfcca01ffb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -51,12 +51,13 @@ jobs: - name: Run ECLint check run: editorconfig-checker -exclude README.md $(git ls-files | grep -v test) - pytest-changes: - name: pytest-changes + changes: + name: changes runs-on: self-hosted outputs: # Expose matched filters as job 'modules' output variable - modules: ${{ steps.filter.outputs.changes }} + pytest_modules: ${{ steps.pytest-filter.outputs.changes }} + nftest_modules: ${{ steps.nftest-filter.outputs.changes }} steps: - uses: actions/checkout@v4 with: @@ -64,11 +65,26 @@ jobs: # TODO: change back to using dorny/paths-filter when https://github.com/dorny/paths-filter/pull/133 is implemented - uses: mirpedrol/paths-filter@main - id: filter + id: pytest-filter with: filters: "tests/config/pytest_modules.yml" token: "" + ## nf-test + - name: Combine all tags.yml files + id: get_username + run: find . -name "tags.yml" -not -path "./.github/*" -exec cat {} + > .github/tags.yml + + - name: debug + run: cat .github/tags.yml + + # TODO: change back to using dorny/paths-filter when https://github.com/dorny/paths-filter/pull/133 is implemented + - uses: mirpedrol/paths-filter@main + id: nftest-filter + with: + filters: ".github/tags.yml" + token: "" + nf-core-lint: runs-on: self-hosted name: nf-core-lint @@ -123,8 +139,8 @@ jobs: pytest: runs-on: ubuntu-latest name: pytest - needs: [pytest-changes] - if: needs.pytest-changes.outputs.modules != '[]' + needs: [changes] + if: needs.changes.outputs.pytest_modules != '[]' strategy: fail-fast: false matrix: @@ -393,36 +409,11 @@ jobs: !/home/runner/pytest_workflow_*/*/work/singularity !${{ github.workspace }}/.singularity - nf-test-changes: - name: nf-test-changes - runs-on: ubuntu-latest - outputs: - # Expose matched filters as job 'modules' output variable - modules: ${{ steps.filter.outputs.changes }} - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 2 # To retrieve the preceding commit. - - - name: Combine all tags.yml files - id: get_username - run: find . -name "tags.yml" -not -path "./.github/*" -exec cat {} + > .github/tags.yml - - - name: debug - run: cat .github/tags.yml - - # TODO: change back to using dorny/paths-filter when https://github.com/dorny/paths-filter/pull/133 is implemented - - uses: mirpedrol/paths-filter@main - id: filter - with: - filters: ".github/tags.yml" - token: "" - nf-test: runs-on: ubuntu-latest name: nf-test - needs: [nf-test-changes] - if: needs.nf-test-changes.outputs.modules != '[]' + needs: [changes] + if: needs.changes.outputs.nftest_modules != '[]' strategy: fail-fast: false matrix: