Skip to content

Commit 4a7bccd

Browse files
committed
ci: skip integration tests if CLOUDSCALE_API_TOKEN is missing
1 parent f778376 commit 4a7bccd

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/ccm-integration-tests.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,33 @@ jobs:
119119
image.tar.sha256
120120
retention-days: 30d
121121

122+
check-ccm-integration:
123+
# Preflight: verify the CLOUDSCALE_API_TOKEN at step-level and set an output
124+
# so the integration job can be skipped.
125+
#
126+
# GitHub Actions limitations motivating this:
127+
# - `secrets` are NOT available in `jobs.<id>.if` (job-level `if`), so you cannot
128+
# directly gate/skip a job by testing a secret there.
129+
name: Check CCM Integration Configuration
130+
runs-on: ubuntu-latest
131+
132+
outputs:
133+
integration-enabled: ${{ steps.check.outputs.enabled }}
134+
135+
steps:
136+
- id: check
137+
name: Verify CLOUDSCALE_API_TOKEN is present
138+
env:
139+
CLOUDSCALE_API_TOKEN: ${{ secrets.CLOUDSCALE_API_TOKEN }}
140+
run: |
141+
if [ -n "$CLOUDSCALE_API_TOKEN" ]; then
142+
echo "enabled=true" >> $GITHUB_OUTPUT
143+
echo "CLOUDSCALE_API_TOKEN found — integration will run."
144+
else
145+
echo "enabled=false" >> $GITHUB_OUTPUT
146+
echo "CLOUDSCALE_API_TOKEN not configured — skipping integration."
147+
fi
148+
122149
integration:
123150
name: "Kubernetes ${{ matrix.kubernetes }}"
124151
runs-on: ubuntu-latest
@@ -128,6 +155,8 @@ jobs:
128155
- unit
129156
- test-matrix
130157
- build-image
158+
- check-ccm-integration
159+
if: needs.check-ccm-integration.outputs.integration-enabled == 'true'
131160

132161
strategy:
133162
fail-fast: false

0 commit comments

Comments
 (0)