Skip to content

Commit

Permalink
ci: One changes job to rule them all
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundmiller committed Nov 2, 2023
1 parent 1ea452c commit 7446808
Showing 1 changed file with 24 additions and 33 deletions.
57 changes: 24 additions & 33 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,40 @@ 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:
fetch-depth: 2 # To retrieve the preceding commit.

# 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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 7446808

Please sign in to comment.