Skip to content

Commit

Permalink
try out new parallization strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Nov 30, 2023
1 parent 20dbeec commit 53bf326
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- "CHANGELOG.md"
release:
types: [published]
workflow_dispatch:

# Cancel if a newer run is started
concurrency:
Expand Down Expand Up @@ -54,11 +55,31 @@ jobs:
runner: ${{ matrix.runner }}
run-tests: ${{ env.run-tests }}

# create a test matrix based on all python files in /tests
list_tests:
name: Get test file matrix
needs: setup
if: ${{ needs.setup.outputs.run-tests == 'true' }}
runs-on: ${{ needs.setup.outputs.runner }}
outputs:
tests: ${{ steps.list_tests.outputs.tests }}
steps:
- uses: actions/checkout@v2
name: Check out source-code repository

- name: List tests
id: list_tests
run: |
echo "tests=$(find tests -name '*.py' -exec basename {} .py \; | tr '\n' ',')" >> $GITHUB_ENV
test:
name: Test with Python ${{ needs.setup.outputs.python-version }} on ${{ needs.setup.outputs.runner }}
needs: setup
needs: [setup, list_tests]
if: ${{ needs.setup.outputs.run-tests == 'true' }}
runs-on: ${{ needs.setup.outputs.runner }}
strategy:
matrix:
test: ${{ needs.list_tests.outputs.tests }}
steps:
- uses: actions/checkout@v2
name: Check out source-code repository
Expand Down Expand Up @@ -106,7 +127,7 @@ jobs:
sudo mv nf-test /usr/local/bin/
- name: Test with pytest
run: python3 -m pytest tests/ --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core
run: python3 -m pytest tests/${{matrix.test}} --color=yes --cov-report=xml --cov-config=.github/.coveragerc --cov=nf_core --

- uses: codecov/codecov-action@v1
name: Upload code coverage report
Expand Down

0 comments on commit 53bf326

Please sign in to comment.