Skip to content

Commit 9fba67b

Browse files
committed
fix(ci): GCP test: stop per-shape jobs skipping when build-cit is skipped
The per-shape jobs carry a custom job-level `if`, which makes GitHub implicitly prepend success(). success() returns false when any needs job is skipped, and build-cit is skipped whenever cit_git_repo is empty — so every shape was skipped regardless of the arch input. Use !cancelled() to suppress the implicit success(), and gate explicitly on test-gcp-initialtest so a failed smoke test still blocks while build-cit's skipped/success state is ignored.
1 parent 8b0e9ba commit 9fba67b

1 file changed

Lines changed: 25 additions & 4 deletions

File tree

.github/workflows/gcp-test.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,11 @@ jobs:
8080
8181
# Optional: build cloud-image-tests from a user-supplied git repo+ref and
8282
# publish a docker tarball as an artifact. All test jobs `needs:` this; when
83-
# cit_git_repo is empty this job is skipped, which GitHub Actions treats as
84-
# non-blocking (skipped != failed), so test jobs run as today.
83+
# cit_git_repo is empty this job is skipped. A skipped need is only
84+
# non-blocking for jobs with NO custom `if` (e.g. test-gcp-initialtest). Jobs
85+
# with a custom `if` (the per-shape jobs) get an implicit success() prepended,
86+
# which DOES treat a skipped need as failure — so those jobs use !cancelled()
87+
# + an explicit needs.test-gcp-initialtest.result check instead.
8588
build-cit:
8689
name: Build cloud-image-tests from source
8790
if: inputs.cit_git_repo != ''
@@ -200,7 +203,16 @@ jobs:
200203
id-token: write
201204
contents: read
202205
runs-on: "${{ github.repository_owner == 'AlmaLinux' && format('runs-on={0}/runner=2cpu-linux-x64/spot=false/volume=100g/image=almalinux-10-x86_64', github.run_id) || 'ubuntu-24.04' }}"
203-
if: inputs.arch == 'ALL' || inputs.arch == 'x86_64'
206+
# A custom job-level `if` makes GitHub implicitly prepend success(), which
207+
# returns false when ANY needs job is skipped — and build-cit IS skipped
208+
# whenever cit_git_repo is empty, which would wrongly skip every shape.
209+
# The !cancelled() status function suppresses that implicit success(); we
210+
# then gate explicitly on test-gcp-initialtest so a failed smoke test still
211+
# blocks, while build-cit's skipped/success state is intentionally ignored.
212+
if: >-
213+
!cancelled()
214+
&& needs.test-gcp-initialtest.result == 'success'
215+
&& (inputs.arch == 'ALL' || inputs.arch == 'x86_64')
204216
timeout-minutes: 720
205217
strategy:
206218
fail-fast: false
@@ -344,7 +356,16 @@ jobs:
344356
id-token: write
345357
contents: read
346358
runs-on: ubuntu-24.04
347-
if: inputs.arch == 'ALL' || inputs.arch == 'aarch64'
359+
# A custom job-level `if` makes GitHub implicitly prepend success(), which
360+
# returns false when ANY needs job is skipped — and build-cit IS skipped
361+
# whenever cit_git_repo is empty, which would wrongly skip every shape.
362+
# The !cancelled() status function suppresses that implicit success(); we
363+
# then gate explicitly on test-gcp-initialtest so a failed smoke test still
364+
# blocks, while build-cit's skipped/success state is intentionally ignored.
365+
if: >-
366+
!cancelled()
367+
&& needs.test-gcp-initialtest.result == 'success'
368+
&& (inputs.arch == 'ALL' || inputs.arch == 'aarch64')
348369
timeout-minutes: 720
349370
strategy:
350371
fail-fast: false

0 commit comments

Comments
 (0)