diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 5a29a7d5..5586886c 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -266,3 +266,39 @@ jobs: if (p + 0 < f + 0) { printf "FAIL: line coverage %.2f%% is below floor %s%%\n", p, f; exit 1 } printf "OK: line coverage %.2f%% >= floor %s%%\n", p, f }' + + # One context for the Branch-Floor ruleset, which requires `CI/gate` (owner + # ruling 2026-11-17: keep that requirement and give it a producer). Until + # this job existed nothing emitted `CI/gate`, so every pull request stayed + # blocked with no failing check to say why. The job name is the context, so + # it carries no `rust-ci / ` prefix. It passes only when Cargo.toml was + # found and every Rust job above succeeded: a skipped, cancelled or missing + # job fails it, so the gate cannot go green on work that did not run. + gate: + timeout-minutes: 5 + name: CI/gate + runs-on: ubuntu-latest + needs: [detect, check, test, audit, coverage] + if: always() + permissions: {} + steps: + - name: Check every Rust job succeeded + env: + NEEDS_JSON: ${{ toJSON(needs) }} + run: | + set -euo pipefail + has_cargo=$(jq -r '.detect.outputs.has_cargo // "missing"' <<< "$NEEDS_JSON") + if [ "$has_cargo" != true ]; then + echo "::error::Cargo.toml was not detected (has_cargo=$has_cargo); echidna is a Rust workspace, so this is a failure, not a skip" + exit 1 + fi + failed=0 + for job in detect check test audit coverage; do + result=$(jq -r --arg job "$job" '.[$job].result // "missing"' <<< "$NEEDS_JSON") + if [ "$result" != success ]; then + echo "::error::$job did not succeed (result: $result)" + failed=1 + fi + done + [ "$failed" = 0 ] || exit 1 + echo "CI/gate passed: detect, check, test, audit and coverage all succeeded."