Merge Queue Tasks #20627
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: Merge Queue Tasks | |
| on: | |
| merge_group: | |
| workflow_dispatch: | |
| jobs: | |
| # HOW JOBS ARE STRUCTURED IN THIS FILE | |
| # | |
| # Each substantive job (build, test, etc.) must have a matching | |
| # cancel-if-<name>-failed sentinel job in the cancel-if-* section below. | |
| # GitHub Actions does not cancel sibling jobs when one job fails — they keep | |
| # running and waste runner time. The sentinels work around this: each one | |
| # watches a single upstream job and immediately cancels the entire run on | |
| # failure. | |
| # | |
| # IMPORTANT: The sentinel cancel is asynchronous. Any job that must not run | |
| # when a prior job fails MUST also list that job in its `needs:` field and | |
| # check its result in its `if:` condition — do not rely on the cancel alone. | |
| # Example: invoke-tests-web-console-unit runs in parallel with the build | |
| # jobs, so invoke-build-docker lists it in `needs:` and checks its result in | |
| # `if:`. Without that explicit gate, the Docker build can start before the | |
| # cancel propagates and waste expensive runner time. | |
| invoke-build-rust: | |
| name: Build Rust | |
| uses: ./.github/workflows/build-rust.yml | |
| secrets: inherit | |
| invoke-build-java: | |
| name: Build Java | |
| uses: ./.github/workflows/build-java.yml | |
| secrets: inherit | |
| invoke-build-docs: | |
| name: Build Docs | |
| uses: ./.github/workflows/build-docs.yml | |
| secrets: inherit | |
| invoke-tests-web-console-unit: | |
| name: Web Console Unit Tests | |
| uses: ./.github/workflows/test-web-console-unit.yml | |
| secrets: inherit | |
| invoke-tests-unit: | |
| name: Unit Tests | |
| needs: [invoke-build-rust, invoke-build-java] | |
| uses: ./.github/workflows/test-unit.yml | |
| secrets: inherit | |
| invoke-tests-adapter: | |
| name: Adapter Tests | |
| needs: [invoke-build-rust] | |
| uses: ./.github/workflows/test-adapters.yml | |
| secrets: inherit | |
| invoke-build-docker: | |
| name: Build Docker | |
| needs: [invoke-build-rust, invoke-build-java, invoke-tests-web-console-unit] | |
| if: | | |
| always() && | |
| (needs.invoke-build-rust.result == 'success' || needs.invoke-build-rust.result == 'skipped') && | |
| (needs.invoke-build-java.result == 'success' || needs.invoke-build-java.result == 'skipped') && | |
| (needs.invoke-tests-web-console-unit.result == 'success' || needs.invoke-tests-web-console-unit.result == 'skipped') | |
| uses: ./.github/workflows/build-docker.yml | |
| secrets: inherit | |
| invoke-generate-sbom: | |
| name: Generate SBOMs | |
| needs: [invoke-build-docker] | |
| uses: ./.github/workflows/generate-sbom.yml | |
| secrets: inherit | |
| invoke-tests-web-console-e2e: | |
| name: Web Console End-to-End Tests | |
| needs: [invoke-build-docker] | |
| if: | | |
| always() && | |
| (needs.invoke-build-docker.result == 'success' || needs.invoke-build-docker.result == 'skipped') | |
| uses: ./.github/workflows/test-web-console-e2e.yml | |
| secrets: inherit | |
| invoke-tests-integration-platform: | |
| name: Integration Tests | |
| needs: [invoke-build-docker] | |
| uses: ./.github/workflows/test-integration-platform.yml | |
| secrets: inherit | |
| invoke-tests-integration-runtime: | |
| name: Integration Tests | |
| needs: [invoke-build-java] | |
| uses: ./.github/workflows/test-integration-runtime.yml | |
| secrets: inherit | |
| invoke-tests-java: | |
| name: Java Tests | |
| needs: [invoke-build-java] | |
| uses: ./.github/workflows/test-java.yml | |
| secrets: inherit | |
| invoke-publish-crates-dry-run: | |
| name: Publish Crates (Dry Run) | |
| needs: [invoke-build-rust] | |
| uses: ./.github/workflows/publish-crates.yml | |
| with: | |
| environment: ci | |
| secrets: inherit | |
| cancel-if-tests-web-console-unit-failed: | |
| name: Cancel if Web Console Unit Tests Failed | |
| needs: [invoke-tests-web-console-unit] | |
| if: failure() | |
| runs-on: ubuntu-latest-amd64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Cancel workflow | |
| run: | | |
| curl -fsSL -X POST \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| cancel-if-build-rust-failed: | |
| name: Cancel if Rust Build Failed | |
| needs: [invoke-build-rust] | |
| if: failure() | |
| runs-on: ubuntu-latest-amd64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Cancel workflow | |
| run: | | |
| curl -fsSL -X POST \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| cancel-if-build-java-failed: | |
| name: Cancel if Java Build Failed | |
| needs: [invoke-build-java] | |
| if: failure() | |
| runs-on: ubuntu-latest-amd64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Cancel workflow | |
| run: | | |
| curl -fsSL -X POST \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| cancel-if-build-docs-failed: | |
| name: Cancel if Docs Build Failed | |
| needs: [invoke-build-docs] | |
| if: failure() | |
| runs-on: ubuntu-latest-amd64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Cancel workflow | |
| run: | | |
| curl -fsSL -X POST \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| cancel-if-tests-unit-failed: | |
| name: Cancel if Unit Tests Failed | |
| needs: [invoke-tests-unit] | |
| if: failure() | |
| runs-on: ubuntu-latest-amd64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Cancel workflow | |
| run: | | |
| curl -fsSL -X POST \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| cancel-if-tests-adapter-failed: | |
| name: Cancel if Adapter Tests Failed | |
| needs: [invoke-tests-adapter] | |
| if: failure() | |
| runs-on: ubuntu-latest-amd64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Cancel workflow | |
| run: | | |
| curl -fsSL -X POST \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| cancel-if-build-docker-failed: | |
| name: Cancel if Docker Build Failed | |
| needs: [invoke-build-docker] | |
| if: failure() | |
| runs-on: ubuntu-latest-amd64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Cancel workflow | |
| run: | | |
| curl -fsSL -X POST \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| cancel-if-tests-web-console-integration-failed: | |
| name: Cancel if Web Console Integration Tests Failed | |
| needs: [invoke-tests-web-console-e2e] | |
| if: failure() | |
| runs-on: ubuntu-latest-amd64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Cancel workflow | |
| run: | | |
| curl -fsSL -X POST \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| cancel-if-tests-integration-platform-failed: | |
| name: Cancel if Platform Integration Tests Failed | |
| needs: [invoke-tests-integration-platform] | |
| if: failure() | |
| runs-on: ubuntu-latest-amd64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Cancel workflow | |
| run: | | |
| curl -fsSL -X POST \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| cancel-if-tests-integration-runtime-failed: | |
| name: Cancel if Runtime Integration Tests Failed | |
| needs: [invoke-tests-integration-runtime] | |
| if: failure() | |
| runs-on: ubuntu-latest-amd64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Cancel workflow | |
| run: | | |
| curl -fsSL -X POST \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| cancel-if-tests-java-failed: | |
| name: Cancel if Java Tests Failed | |
| needs: [invoke-tests-java] | |
| if: failure() | |
| runs-on: ubuntu-latest-amd64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Cancel workflow | |
| run: | | |
| curl -fsSL -X POST \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| cancel-if-publish-crates-dry-run-failed: | |
| name: Cancel if Publish Crates Dry Run Failed | |
| needs: [invoke-publish-crates-dry-run] | |
| if: failure() | |
| runs-on: ubuntu-latest-amd64 | |
| permissions: | |
| actions: write | |
| steps: | |
| - name: Cancel workflow | |
| run: | | |
| curl -fsSL -X POST \ | |
| -H "Authorization: Bearer ${{ github.token }}" \ | |
| -H "Accept: application/vnd.github+json" \ | |
| "https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel" | |
| # This job needs to be called main (the same as the ci-pre-mergequeue.yml workflow) | |
| # because of how merge queues work: https://stackoverflow.com/a/78030618 | |
| # and https://github.com/orgs/community/discussions/103114 | |
| main: | |
| if: always() | |
| runs-on: ubuntu-latest-amd64 | |
| needs: | |
| - invoke-build-rust | |
| - invoke-build-java | |
| - invoke-build-docs | |
| - invoke-tests-web-console-unit | |
| - invoke-tests-web-console-e2e | |
| - invoke-tests-unit | |
| - invoke-tests-adapter | |
| - invoke-build-docker | |
| - invoke-generate-sbom | |
| - invoke-tests-integration-platform | |
| - invoke-tests-integration-runtime | |
| - invoke-tests-java | |
| - invoke-publish-crates-dry-run | |
| steps: | |
| - name: Finalize Workflow | |
| run: echo "All tasks completed!" | |
| - if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }} | |
| run: exit 1 |