Commit 177beb4
fix(ci): prevent matrix-generation steps from masking gradle failures
The dynamic matrix steps (find_gradle_jobs, find_examples_jobs,
find_docs_examples_jobs) captured `./gradlew testMatrix` output inside a
command substitution, in two cases piped into jq. In a pipeline the step
exit status is that of the last command (jq), so a gradle failure (e.g. a
module that does not compile) was masked: jq exits 0 on empty input, the
step reported success, and an empty/invalid matrix was emitted.
An empty matrix means GitHub spawns zero `check` jobs, and since the
downstream jobs are chained via `needs:`
(check -> find_examples_jobs -> check_examples -> find_docs_examples_jobs
-> check_docs_examples), they all get skipped. The net effect is a
falsely-green build that ran no module checks at all. This recently let a
breaking dependency bump (cassandra-driver-core 4.0.0) pass CI as green.
Fix: add `set -o pipefail` and run gradle on its own line, redirecting
output to a file before handing it to jq. Gradle's non-zero exit is now
caught directly by the default `set -e`, before the matrix output is
written.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 905a445 commit 177beb4
1 file changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
133 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
134 | 138 | | |
135 | 139 | | |
136 | 140 | | |
| |||
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
167 | | - | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
168 | 174 | | |
169 | 175 | | |
170 | 176 | | |
| |||
0 commit comments