|
80 | 80 |
|
81 | 81 | # Optional: build cloud-image-tests from a user-supplied git repo+ref and |
82 | 82 | # 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. |
85 | 88 | build-cit: |
86 | 89 | name: Build cloud-image-tests from source |
87 | 90 | if: inputs.cit_git_repo != '' |
@@ -200,7 +203,16 @@ jobs: |
200 | 203 | id-token: write |
201 | 204 | contents: read |
202 | 205 | 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') |
204 | 216 | timeout-minutes: 720 |
205 | 217 | strategy: |
206 | 218 | fail-fast: false |
@@ -344,7 +356,16 @@ jobs: |
344 | 356 | id-token: write |
345 | 357 | contents: read |
346 | 358 | 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') |
348 | 369 | timeout-minutes: 720 |
349 | 370 | strategy: |
350 | 371 | fail-fast: false |
|
0 commit comments