chore: fix all-passed gate to run with if: always() #356
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: Pipeline | |
| on: | |
| push: | |
| permissions: | |
| contents: write | |
| actions: read | |
| checks: write | |
| pull-requests: write | |
| jobs: | |
| lint-commits: | |
| name: Run Commitlint Checks | |
| if: github.event_name == 'pull_request' | |
| uses: ./.github/workflows/commitlint.yml | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| secrets: inherit | |
| code-style: | |
| name: Run Linter Formatter | |
| uses: ./.github/workflows/linting.yml | |
| with: | |
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} | |
| commit_changes: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | |
| secrets: inherit | |
| compat-check: | |
| name: Run Compatibility Checks | |
| uses: ./.github/workflows/integration.yml | |
| with: | |
| library_ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} | |
| sanity_ref: sanity | |
| secrets: inherit | |
| type-check: | |
| name: Run Type Checks | |
| uses: ./.github/workflows/typecheck.yml | |
| with: | |
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} | |
| secrets: inherit | |
| run-tests: | |
| name: Run Test Suite | |
| uses: ./.github/workflows/test.yml | |
| with: | |
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} | |
| secrets: inherit | |
| code-inspection: | |
| name: Run Qodana Inspections | |
| needs: run-tests | |
| if: ${{ always() }} | |
| uses: ./.github/workflows/qodana.yml | |
| with: | |
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} | |
| secrets: inherit | |
| build-docker: | |
| name: Build Docker Container | |
| needs: run-tests | |
| uses: ./.github/workflows/docker.yml | |
| with: | |
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} | |
| secrets: inherit | |
| check-deps: | |
| name: Run Dependency Checks | |
| uses: ./.github/workflows/unused.yml | |
| with: | |
| ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref }} | |
| secrets: inherit | |
| all-passed: | |
| name: Check Build Status | |
| runs-on: ubuntu-latest | |
| if: always() | |
| needs: | |
| - lint-commits | |
| - code-style | |
| - compat-check | |
| - type-check | |
| - run-tests | |
| - code-inspection | |
| - build-docker | |
| - check-deps | |
| steps: | |
| - name: Harden runner | |
| uses: step-security/harden-runner@0634a2670c59f64b4a01f0f96f84700a4088b9f0 # v2.12.0 | |
| with: | |
| egress-policy: audit | |
| - name: Verify all jobs passed | |
| run: | | |
| if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then | |
| echo "One or more jobs failed or were cancelled." | |
| exit 1 | |
| fi |