Skip to content

Commit b41e7ac

Browse files
ci: add the CI/gate aggregator required by Branch-Floor (#389)
## Summary The repository ruleset "Branch-Floor" (id 23869574) requires a status check whose context is exactly `CI/gate`, but no workflow in this repository emitted a check with that name, so no pull request could merge (for example #381). The owner chose to satisfy the gate rather than edit or bypass the ruleset. This adds one job to `.github/workflows/agda.yml`: `ci-gate`, `name: "CI/gate"`. It is copied from the `ci-gate` job in hyperpolymath/ordinal-notation `proven-tests.yml`. - `needs:` every other job in the workflow: `check`, `cold-check`, `experimental` (Experimental echo-additive), `narrowing` (Bit-narrowing exhibit), `cubical` (Cubical epi/mono profile), `rocq-recheck` (Rocq recheck leg), `lean-recheck` (Lean recheck leg). - `if: always()`, `permissions: {}`, `runs-on: ubuntu-24.04`, `timeout-minutes: 5`, a single `run:` step and no `uses:`, so no lock entries are needed. - Passes only if every needed job's result is `success`. Failure, cancelled, skipped or missing results fail the gate. A job in `needs` that is not listed as required or advisory also fails it. - No existing job, proof file, other workflow or ruleset is changed. ## Checks run locally `check-agda-invocations.sh`, `kernel-guard.sh`, `check-guardrails.sh proofs/agda` and `check-experimental-aggregate.sh` all pass. The workflow parses as YAML with 8 jobs. The gate script was run against simulated `needs` JSON: all-success exits 0, and a cancelled job exits 1. The repo has no actions lock file or workflow-lint script. The commit is SSH-signed. Whether `CI/gate` appears on this PR's own run and passes is still unconfirmed at the time of writing. I'm watching the run and will report here. --- _Generated by [Claude Code](https://claude.ai/code)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent 140002f commit b41e7ac

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

‎.github/workflows/agda.yml‎

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,82 @@ jobs:
147147
run: bash scripts/setup-recheck.sh lean
148148
- name: Check the Lean leg (no axioms)
149149
run: bash scripts/check-recheck.sh lean
150+
151+
# ==========================================================================
152+
# Required status check "CI/gate" (Branch-Floor ruleset).
153+
# The check context is this job's name. It waits for every other job in this
154+
# workflow and runs even when one fails, is cancelled or is skipped; it exits
155+
# 0 only when every required job succeeded. Pattern:
156+
# hyperpolymath/ordinal-notation proven-tests.yml, job ci-gate.
157+
# ==========================================================================
158+
ci-gate:
159+
name: "CI/gate"
160+
runs-on: ubuntu-24.04
161+
timeout-minutes: 5
162+
permissions: {}
163+
needs: [check, cold-check, experimental, narrowing, cubical, rocq-recheck, lean-recheck]
164+
if: always()
165+
steps:
166+
- name: Require every needed job to have succeeded
167+
env:
168+
NEEDS_JSON: ${{ toJSON(needs) }}
169+
REQUIRED_JOBS: "check cold-check experimental narrowing cubical rocq-recheck lean-recheck"
170+
ADVISORY_JOBS: ""
171+
DESIGNED_SKIPS: ""
172+
run: |
173+
set -euo pipefail
174+
summary="${GITHUB_STEP_SUMMARY:-/dev/null}"
175+
result_of() { local job="$1"; jq -r --arg j "$job" '.[$j].result // "missing"' <<< "$NEEDS_JSON"; }
176+
in_list() { local needle="$1" haystack="$2"; case " $haystack " in *" $needle "*) return 0 ;; esac; return 1; }
177+
detector_of() {
178+
local job="$1" pair
179+
for pair in $DESIGNED_SKIPS; do
180+
if [ "${pair%%:*}" = "$job" ]; then echo "${pair#*:}"; return 0; fi
181+
done
182+
return 1
183+
}
184+
row() { printf '| %s | %s | %s | %s |\n' "$@" | tee -a "$summary"; }
185+
{
186+
echo "### CI/gate"
187+
echo
188+
echo "| job | result | role | verdict |"
189+
echo "|---|---|---|---|"
190+
} | tee -a "$summary"
191+
fail=0
192+
total=0
193+
passed=0
194+
for j in $REQUIRED_JOBS; do
195+
total=$((total + 1))
196+
r=$(result_of "$j")
197+
case "$r" in
198+
success) v="ok"; passed=$((passed + 1)) ;;
199+
skipped)
200+
if d=$(detector_of "$j") && [ "$(result_of "$d")" = "success" ]; then
201+
v="ok (designed skip; detector $d succeeded)"; passed=$((passed + 1))
202+
else
203+
v="FAIL (skipped without a successful detector)"; fail=1
204+
fi ;;
205+
*) v="FAIL (result must be success)"; fail=1 ;;
206+
esac
207+
row "$j" "$r" required "$v"
208+
done
209+
for j in $ADVISORY_JOBS; do
210+
row "$j" "$(result_of "$j")" advisory "not gating"
211+
done
212+
for j in $(jq -r 'keys[]' <<< "$NEEDS_JSON"); do
213+
if ! in_list "$j" "$REQUIRED_JOBS $ADVISORY_JOBS"; then
214+
row "$j" "$(result_of "$j")" unclassified "FAIL (job is in needs but neither required nor advisory)"
215+
fail=1
216+
fi
217+
done
218+
if [ "$total" -eq 0 ]; then
219+
echo "::error::no required jobs configured"
220+
fail=1
221+
fi
222+
msg="required jobs: $total; satisfied: $passed; advisory: $(wc -w <<< "$ADVISORY_JOBS")"
223+
echo "$msg" | tee -a "$summary"
224+
if [ "$fail" -ne 0 ]; then
225+
echo "::error::CI/gate failed ($msg)"
226+
exit 1
227+
fi
228+
echo "CI/gate passed ($msg)"

0 commit comments

Comments
 (0)