22
33on :
44 push :
5- branches : [main]
5+ branches :
6+ - main
7+ - ' chore/release-*'
68 pull_request :
79 types : [opened, synchronize]
810 workflow_dispatch :
@@ -319,6 +321,21 @@ jobs:
319321
320322 - name : Run tests
321323 run : cargo test --verbose
324+
325+ benchmark-go :
326+ if : ${{ startsWith(github.ref_name, 'chore/release-') || startsWith(github.head_ref, 'chore/release-') }}
327+ permissions :
328+ contents : read
329+ id-token : write
330+ uses : ./.github/workflows/benchmark-go.yml
331+
332+ benchmark-cli :
333+ if : ${{ startsWith(github.ref_name, 'chore/release-') || startsWith(github.head_ref, 'chore/release-') }}
334+ permissions :
335+ contents : read
336+ id-token : write
337+ uses : ./.github/workflows/benchmark-cli.yml
338+
322339 done :
323340 needs :
324341 - test-go
@@ -328,9 +345,44 @@ jobs:
328345 - lint
329346 - test-wasm
330347 - test-rust
348+ - benchmark-go
349+ - benchmark-cli
331350 if : always()
332351 runs-on : ubuntu-latest
333352 name : CI Done
334353 steps :
335- - run : exit 1
336- if : ${{ always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')) }}
354+ - name : Verify required jobs completed
355+ env :
356+ IS_RELEASE_BRANCH : ${{ startsWith(github.ref_name, 'chore/release-') || startsWith(github.head_ref, 'chore/release-') }}
357+ TEST_GO_RESULT : ${{ needs.test-go.result }}
358+ TEST_GO_WINDOWS_RESULT : ${{ needs.test-go-windows.result }}
359+ TEST_NODE_RESULT : ${{ needs.test-node.result }}
360+ TEST_NODE_WINDOWS_RESULT : ${{ needs.test-node-windows.result }}
361+ LINT_RESULT : ${{ needs.lint.result }}
362+ TEST_WASM_RESULT : ${{ needs.test-wasm.result }}
363+ TEST_RUST_RESULT : ${{ needs.test-rust.result }}
364+ BENCHMARK_GO_RESULT : ${{ needs.benchmark-go.result }}
365+ BENCHMARK_CLI_RESULT : ${{ needs.benchmark-cli.result }}
366+ run : |
367+ required_results=(
368+ "$TEST_GO_RESULT"
369+ "$TEST_GO_WINDOWS_RESULT"
370+ "$TEST_NODE_RESULT"
371+ "$TEST_NODE_WINDOWS_RESULT"
372+ "$LINT_RESULT"
373+ "$TEST_WASM_RESULT"
374+ "$TEST_RUST_RESULT"
375+ )
376+
377+ if [ "$IS_RELEASE_BRANCH" = "true" ]; then
378+ required_results+=(
379+ "$BENCHMARK_GO_RESULT"
380+ "$BENCHMARK_CLI_RESULT"
381+ )
382+ fi
383+
384+ for result in "${required_results[@]}"; do
385+ if [ "$result" != "success" ]; then
386+ exit 1
387+ fi
388+ done
0 commit comments