From 177beb438ca1cd4b7716a84f0a5ff6584365c1c7 Mon Sep 17 00:00:00 2001 From: Kevin Wittek Date: Wed, 10 Jun 2026 18:19:44 +0200 Subject: [PATCH] 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 --- .github/workflows/ci.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc128acb50c..349e21c6b80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -96,7 +96,9 @@ jobs: # we should not push empty results to the cache READ_ONLY_REMOTE_GRADLE_CACHE: true run: | - TASKS=$(./gradlew --no-daemon --parallel -q testMatrix | jq 'del(.[] | select(. == ":testcontainers:check" or startswith(":docs:")))' --compact-output) + set -o pipefail + ./gradlew --no-daemon --parallel -q testMatrix > matrix.json + TASKS=$(jq 'del(.[] | select(. == ":testcontainers:check" or startswith(":docs:")))' --compact-output matrix.json) echo $TASKS echo "matrix={\"gradle_args\":$TASKS}" >> $GITHUB_OUTPUT check: @@ -130,7 +132,9 @@ jobs: # we should not push empty results to the cache READ_ONLY_REMOTE_GRADLE_CACHE: true run: | - TASKS=$(./gradlew --no-daemon --parallel -q testMatrix) + set -o pipefail + ./gradlew --no-daemon --parallel -q testMatrix > matrix.json + TASKS=$(cat matrix.json) echo $TASKS echo "matrix={\"gradle_args\":$TASKS}" >> $GITHUB_OUTPUT check_examples: @@ -164,7 +168,9 @@ jobs: # we should not push empty results to the cache READ_ONLY_REMOTE_GRADLE_CACHE: true run: | - TASKS=$(./gradlew --no-daemon --parallel -q testMatrix | jq 'map(select(startswith(":docs:")))' --compact-output) + set -o pipefail + ./gradlew --no-daemon --parallel -q testMatrix > matrix.json + TASKS=$(jq 'map(select(startswith(":docs:")))' --compact-output matrix.json) echo $TASKS echo "matrix={\"gradle_args\":$TASKS}" >> $GITHUB_OUTPUT check_docs_examples: