Skip to content

Commit c5aa8da

Browse files
joostjagerclaude
andcommitted
Add verification that all CI steps were executed
Adds a --verify-complete flag to ci-tests.sh that checks all steps defined in ALL_STEPS were actually run. Each step logs its completion to GITHUB_ENV, and a final verification step ensures nothing was missed. This prevents CI steps from being silently skipped if the workflow and script get out of sync. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 8a620a5 commit c5aa8da

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,9 @@ jobs:
142142
- name: Test cfg-flag builds
143143
shell: bash
144144
run: CI_ENV=1 CI_MINIMIZE_DISK_USAGE=1 ./ci/ci-tests.sh test-cfg-flags
145+
- name: Verify all CI steps ran
146+
shell: bash
147+
run: ./ci/ci-tests.sh --verify-complete
145148

146149
coverage:
147150
needs: fuzz

ci/ci-tests.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,22 @@ fi
5555

5656
WORKSPACE_MEMBERS=( $(cat Cargo.toml | tr '\n' '\r' | sed 's/\r //g' | tr '\r' '\n' | grep '^members =' | sed 's/members.*=.*\[//' | tr -d '"' | tr ',' ' ') )
5757

58+
# Verify that all steps were executed (called at the end of CI)
59+
if [ "$1" = "--verify-complete" ]; then
60+
MISSING_STEPS=""
61+
for STEP in $ALL_STEPS; do
62+
if [[ ! " $CI_COMPLETED_STEPS " == *" $STEP "* ]]; then
63+
MISSING_STEPS="$MISSING_STEPS $STEP"
64+
fi
65+
done
66+
if [ -n "$MISSING_STEPS" ]; then
67+
echo "ERROR: The following CI steps were not executed:$MISSING_STEPS"
68+
exit 1
69+
fi
70+
echo "All CI steps were executed successfully."
71+
exit 0
72+
fi
73+
5874
for STEP in $STEPS_TO_RUN; do
5975
case "$STEP" in
6076

@@ -222,4 +238,9 @@ exit 1
222238
;;
223239

224240
esac
241+
242+
# Log the completed step to GITHUB_ENV for the verification step
243+
if [ -n "$GITHUB_ENV" ]; then
244+
echo "CI_COMPLETED_STEPS=${CI_COMPLETED_STEPS:-} $STEP" >> "$GITHUB_ENV"
245+
fi
225246
done

0 commit comments

Comments
 (0)