🧪 Set the cache key prefix in CI #63
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: Action self-check / smoke-test | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| failing-job: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - run: exit 1 | |
| succeeding-job: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - run: exit 0 | |
| skipped-job: | |
| if: false | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - run: exit 0 | |
| partially-failing-partially-skipped-matrix: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| continue-on-error: ${{ matrix.rc == '1' }} | |
| strategy: | |
| matrix: | |
| rc: | |
| - 0 | |
| - 1 | |
| - 2 | |
| steps: | |
| - if: matrix.rc != '2' | |
| run: exit ${{ matrix.rc }} | |
| wait-for-success: | |
| needs: | |
| - succeeding-job | |
| - skipped-job | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Checkout the src from Git | |
| uses: actions/checkout@v3 | |
| - run: echo 'results=${{ toJSON(needs.*.result) }}' | |
| - uses: ./ | |
| id: check | |
| continue-on-error: true | |
| with: | |
| jobs: ${{ toJSON(needs) }} | |
| - name: Fail on unexpected outcome (assertion step) | |
| run: exit 1 | |
| if: steps.check.outcome != 'failure' | |
| - run: echo 'outputs=${{ toJSON(steps.check.outputs) }}' | |
| if: always() | |
| wait-for-failure: | |
| needs: | |
| - failing-job | |
| - skipped-job | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Checkout the src from Git | |
| uses: actions/checkout@v3 | |
| - run: echo 'results=${{ toJSON(needs.*.result) }}' | |
| - uses: ./ | |
| id: check | |
| continue-on-error: true | |
| with: | |
| jobs: ${{ toJSON(needs) }} | |
| - name: Fail on unexpected outcome (assertion step) | |
| run: exit 1 | |
| if: steps.check.outcome != 'failure' | |
| - run: echo 'outputs=${{ toJSON(steps.check.outputs) }}' | |
| if: always() | |
| wait-for-both: | |
| needs: | |
| - failing-job | |
| - succeeding-job | |
| - skipped-job | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Checkout the src from Git | |
| uses: actions/checkout@v3 | |
| - run: echo 'results=${{ toJSON(needs.*.result) }}' | |
| - uses: ./ | |
| id: check | |
| continue-on-error: true | |
| with: | |
| jobs: ${{ toJSON(needs) }} | |
| - name: Fail on unexpected outcome (assertion step) | |
| run: exit 1 | |
| if: steps.check.outcome != 'failure' | |
| - run: echo 'outputs=${{ toJSON(steps.check.outputs) }}' | |
| if: always() | |
| allow-some-failures: | |
| needs: | |
| - failing-job | |
| - succeeding-job | |
| - skipped-job | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Checkout the src from Git | |
| uses: actions/checkout@v3 | |
| - run: echo 'results=${{ toJSON(needs.*.result) }}' | |
| - uses: ./ | |
| id: check | |
| continue-on-error: true | |
| with: | |
| allowed-failures: >- | |
| ["failing-job", "skipped-job"] | |
| jobs: ${{ toJSON(needs) }} | |
| - name: Fail on unexpected outcome (assertion step) | |
| run: exit 1 | |
| if: steps.check.outcome != 'success' | |
| - run: echo 'outputs=${{ toJSON(steps.check.outputs) }}' | |
| if: always() | |
| allow-some-failures-str: | |
| needs: | |
| - failing-job | |
| - succeeding-job | |
| - skipped-job | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Checkout the src from Git | |
| uses: actions/checkout@v3 | |
| - run: echo 'results=${{ toJSON(needs.*.result) }}' | |
| - uses: ./ | |
| id: check | |
| continue-on-error: true | |
| with: | |
| allowed-failures: failing-job, skipped-job | |
| jobs: ${{ toJSON(needs) }} | |
| - name: Fail on unexpected outcome (assertion step) | |
| run: exit 1 | |
| if: steps.check.outcome != 'success' | |
| - run: echo 'outputs=${{ toJSON(steps.check.outputs) }}' | |
| if: always() | |
| allow-failures-n-skips: | |
| needs: | |
| - failing-job | |
| - succeeding-job | |
| - skipped-job | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Checkout the src from Git | |
| uses: actions/checkout@v3 | |
| - run: echo 'results=${{ toJSON(needs.*.result) }}' | |
| - uses: ./ | |
| id: check | |
| continue-on-error: true | |
| with: | |
| allowed-failures: failing-job | |
| allowed-skips: skipped-job | |
| jobs: ${{ toJSON(needs) }} | |
| - name: Fail on unexpected outcome (assertion step) | |
| run: exit 1 | |
| if: steps.check.outcome != 'success' | |
| - run: echo 'outputs=${{ toJSON(steps.check.outputs) }}' | |
| if: always() | |
| allow-skips: | |
| needs: | |
| - failing-job | |
| - succeeding-job | |
| - skipped-job | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Checkout the src from Git | |
| uses: actions/checkout@v3 | |
| - run: echo 'results=${{ toJSON(needs.*.result) }}' | |
| - uses: ./ | |
| id: check | |
| continue-on-error: true | |
| with: | |
| allowed-skips: failing-job, skipped-job | |
| jobs: ${{ toJSON(needs) }} | |
| - name: Fail on unexpected outcome (assertion step) | |
| run: exit 1 | |
| if: steps.check.outcome != 'failure' | |
| - run: echo 'outputs=${{ toJSON(steps.check.outputs) }}' | |
| if: always() | |
| allow-partials: | |
| needs: | |
| - failing-job | |
| - succeeding-job | |
| - skipped-job | |
| - partially-failing-partially-skipped-matrix | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Checkout the src from Git | |
| uses: actions/checkout@v3 | |
| - run: echo 'results=${{ toJSON(needs.*.result) }}' | |
| - uses: ./ | |
| id: check | |
| continue-on-error: true | |
| with: | |
| allowed-failures: failing-job | |
| allowed-skips: skipped-job | |
| jobs: ${{ toJSON(needs) }} | |
| - name: Fail on unexpected outcome (assertion step) | |
| run: exit 1 | |
| if: steps.check.outcome != 'success' | |
| - run: echo 'outputs=${{ toJSON(steps.check.outputs) }}' | |
| if: always() | |
| tests: | |
| name: 🧪 Tests${{ '' }} # nest jobs under the same sidebar category | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| python-version: | |
| # NOTE: The latest and the lowest supported Pythons are prioritized | |
| # NOTE: to improve the responsiveness. It's nice to see the most | |
| # NOTE: important results first. | |
| - 3.14 | |
| - 3.13 | |
| - 3.12 | |
| - 3.11 | |
| - >- | |
| 3.10 | |
| - ~3.15.0-0 | |
| runner-vm-os: | |
| - ubuntu-24.04-arm | |
| - ubuntu-24.04 | |
| toxenv: | |
| - py | |
| xfail: | |
| - false | |
| uses: tox-dev/workflow/.github/workflows/reusable-tox.yml@617ca35caa695c572377861016677905e58a328c # yamllint disable-line rule:line-length | |
| with: | |
| cache-key-for-dependency-files: '' | |
| check-name: >- | |
| 🧪 🐍${{ | |
| matrix.python-version | |
| }} @ ${{ | |
| matrix.runner-vm-os | |
| }} | |
| job-dependencies-context: >- # context for hooks | |
| ${{ toJSON(needs) }} | |
| python-version: >- | |
| ${{ matrix.python-version }} | |
| runner-vm-os: >- | |
| ${{ matrix.runner-vm-os }} | |
| timeout-minutes: 2 | |
| toxenv: >- | |
| ${{ matrix.toxenv }} | |
| # tox-provision-args: >- | |
| # --force-dep '...' | |
| tox-run-posargs: >- | |
| --cov-report=xml:.tox/.tmp/.test-results/pytest-${{ | |
| matrix.python-version | |
| }}/cobertura.xml | |
| --junitxml=.tox/.tmp/.test-results/pytest-${{ | |
| matrix.python-version | |
| }}/test.xml | |
| tox-rerun-posargs: >- | |
| --no-cov | |
| -vvvvv | |
| --lf | |
| # tox-tool-deps: tox | |
| xfail: false | |
| secrets: | |
| codecov-token: ${{ secrets.CODECOV_TOKEN }} | |
| check: | |
| needs: | |
| - wait-for-success | |
| - wait-for-failure | |
| - wait-for-both | |
| - allow-some-failures | |
| - allow-some-failures-str | |
| - allow-failures-n-skips | |
| - allow-skips | |
| - allow-partials | |
| - tests | |
| if: always() | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 2 | |
| steps: | |
| - name: Checkout the src from Git | |
| uses: actions/checkout@v3 | |
| - uses: ./ | |
| id: check | |
| with: | |
| jobs: ${{ toJSON(needs) }} | |
| ... |