fix: define missing exit code and fix list deletion during iteration #122
Workflow file for this run
This file contains hidden or 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: unittest | |
| on: | |
| pull_request: | |
| branches: [ master ] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.ref }}/unittest | |
| cancel-in-progress: true | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| only-docs: ${{ steps.filter.outputs.only_modified }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - id: filter | |
| uses: tj-actions/changed-files@v47 | |
| with: | |
| files: | | |
| LICENSE | |
| *.md | |
| **/*.md | |
| .github/rulesets/** | |
| .github/workflows/run-crucible-tracking.yaml | |
| .github/workflows/crucible-ci.yaml | |
| .github/workflows/fork-check.yaml | |
| .github/workflows/controller-build.yaml | |
| .github/workflows/unittest.yaml | |
| docs/** | |
| - name: Display changes | |
| run: echo '${{ toJSON(steps.filter.outputs) }}' | jq . | |
| multiplex-unittests: | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: ${{ github.event.pull_request.head.repo.fork != true && (github.event_name == 'workflow_dispatch' || needs.changes.outputs.only-docs != 'true') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| python3 -m venv .venv | |
| source .venv/bin/activate | |
| pip install pytest pytest-html jsonschema | |
| - name: Run unit tests | |
| run: | | |
| source .venv/bin/activate | |
| pytest -v --html=report.html --self-contained-html multiplex.py tests/*.py | |
| - name: Upload html report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: report | |
| path: report.html | |
| faux-unittest: | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| if: ${{ github.event.pull_request.head.repo.fork != true && github.event_name != 'workflow_dispatch' && needs.changes.outputs.only-docs == 'true' }} | |
| steps: | |
| - run: echo "faux-unittest-complete" | |
| unittest-complete: | |
| runs-on: ubuntu-latest | |
| needs: [ multiplex-unittests, faux-unittest ] | |
| if: always() | |
| steps: | |
| - name: Check Results | |
| if: >- | |
| contains(needs.*.result, 'failure') || | |
| contains(needs.*.result, 'cancelled') | |
| run: exit 1 | |
| - run: echo "unittest-complete" |