pytest-workflow Check #791
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: pytest-workflow Check | |
on: | |
workflow_run: | |
workflows: ["Workflows Docker Build"] | |
types: | |
- completed | |
jobs: | |
on-success: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
steps: | |
- run: echo 'The build workflow passed, starting tests' | |
on-failure: | |
runs-on: ubuntu-latest | |
if: ${{ github.event.workflow_run.conclusion == 'failure' }} | |
steps: | |
- run: echo 'The build workflow failed, skipping tests' && exit 1 | |
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 yq --output-format yaml '.[].tags[] ' {} \;| sort | uniq | grep -vE 'deprecated|miniwdl' | 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: | |
lfs: true | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install miniwdl and pytest-workflow | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements-dev.txt | |
- name: filter tests | |
run: | | |
find tests -name '*.yaml' -exec yq --output-format yaml -i 'del(.[] | select(.tags[] | test("reference|deprecated") ) )' {} \; | |
- name: Run pytest-workflow | |
run: | | |
pytest --git-aware --basetemp /home/runner/work/pytest --symlink --tag ${{ matrix.tag }} |