Skip to content

Commit

Permalink
chore: convert pytest to array job
Browse files Browse the repository at this point in the history
  • Loading branch information
adthrasher committed Jun 12, 2024
1 parent f80f516 commit 0600030
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions .github/workflows/pytest-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,22 @@ name: pytest-workflow test
on: [push]

jobs:
list-tags:
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.set-tags.outputs.tags }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: set tags
id: set-tags
run: echo "tags=$(find tests -name '*.yaml' -exec ~/Downloads/yq_darwin_amd64 --output-format yaml '.[].tags[] ' {} \;| sort | uniq | grep -vE 'deprecated|miniwdl|cellranger') | jq -ncR '[inputs]'" >> $GITHUB_OUTPUT
pytest_check:
needs: list-tags
runs-on: ubuntu-latest
strategy:
matrix:
tag: ${{ fromJson(needs.list-tags.outputs.tags) }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -21,10 +35,6 @@ jobs:
run: |
docker pull quay.io/biocontainers/gtfparse:2.5.0--pyh7cba7a3_0 &&
docker pull quay.io/biocontainers/gtfparse:1.2.1--pyh864c0ab_0
- name: filter tests
run: |
find tests -name '*.yaml'| grep -v 'test_util.yaml' | xargs rm &&
find tests -name '*.yaml' -exec yq --output-format yaml -i 'del(.[] | select(.tags[] | test("reference|deprecated|cellranger") ) )' {} \;
- name: Run pytest-workflow
run: |
pytest --git-aware --basetemp /home/runner/work/pytest --symlink
pytest --git-aware --basetemp /home/runner/work/pytest --symlink --tag ${{ matrix.tag }}

0 comments on commit 0600030

Please sign in to comment.