2929 # Enable portable to prevent issues with caching `blst` for the wrong CPU type
3030 TEST_FEATURES : portable
3131jobs :
32+ check-labels :
33+ runs-on : ubuntu-latest
34+ name : Check for 'skip-ci' label
35+ outputs :
36+ skip_ci : ${{ steps.set-output.outputs.SKIP_CI }}
37+ steps :
38+ - name : check for skip-ci label
39+ id : set-output
40+ env :
41+ LABELS : ${{ toJson(github.event.pull_request.labels) }}
42+ run : |
43+ SKIP_CI="false"
44+ if [ -z "${LABELS}" ]; then
45+ LABELS="none";
46+ else
47+ LABELS=$(echo ${LABELS} | jq -r '.[].name')
48+ fi
49+ for label in ${LABELS}; do
50+ if [ "$label" = "skip-ci" ]; then
51+ SKIP_CI="true"
52+ break
53+ fi
54+ done
55+ echo "::set-output name=skip_ci::$SKIP_CI"
56+
3257 target-branch-check :
3358 name : target-branch-check
3459 runs-on : ubuntu-latest
3863 run : test ${{ github.base_ref }} != "stable"
3964 release-tests-ubuntu :
4065 name : release-tests-ubuntu
66+ needs : [check-labels]
67+ if : needs.check-labels.outputs.skip_ci != 'true'
4168 # Use self-hosted runners only on the sigp repo.
4269 runs-on : ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }}
4370 steps :
6390 run : sccache --show-stats
6491 release-tests-windows :
6592 name : release-tests-windows
93+ needs : [check-labels]
94+ if : needs.check-labels.outputs.skip_ci != 'true'
6695 runs-on : ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "windows", "CI"]') || 'windows-2019' }}
6796 steps :
6897 - uses : actions/checkout@v4
97126 run : sccache --show-stats
98127 beacon-chain-tests :
99128 name : beacon-chain-tests
129+ needs : [check-labels]
130+ if : needs.check-labels.outputs.skip_ci != 'true'
100131 # Use self-hosted runners only on the sigp repo.
101132 runs-on : ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }}
102133 env :
@@ -117,6 +148,8 @@ jobs:
117148 run : sccache --show-stats
118149 op-pool-tests :
119150 name : op-pool-tests
151+ needs : [check-labels]
152+ if : needs.check-labels.outputs.skip_ci != 'true'
120153 runs-on : ubuntu-latest
121154 env :
122155 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -132,6 +165,8 @@ jobs:
132165 run : make test-op-pool
133166 network-tests :
134167 name : network-tests
168+ needs : [check-labels]
169+ if : needs.check-labels.outputs.skip_ci != 'true'
135170 runs-on : ubuntu-latest
136171 env :
137172 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -147,6 +182,8 @@ jobs:
147182 run : make test-network
148183 slasher-tests :
149184 name : slasher-tests
185+ needs : [check-labels]
186+ if : needs.check-labels.outputs.skip_ci != 'true'
150187 runs-on : ubuntu-latest
151188 env :
152189 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -162,6 +199,8 @@ jobs:
162199 run : make test-slasher
163200 debug-tests-ubuntu :
164201 name : debug-tests-ubuntu
202+ needs : [check-labels]
203+ if : needs.check-labels.outputs.skip_ci != 'true'
165204 # Use self-hosted runners only on the sigp repo.
166205 runs-on : ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "large"]') || 'ubuntu-latest' }}
167206 env :
@@ -186,6 +225,8 @@ jobs:
186225 run : sccache --show-stats
187226 state-transition-vectors-ubuntu :
188227 name : state-transition-vectors-ubuntu
228+ needs : [check-labels]
229+ if : needs.check-labels.outputs.skip_ci != 'true'
189230 runs-on : ubuntu-latest
190231 steps :
191232 - uses : actions/checkout@v4
@@ -198,6 +239,8 @@ jobs:
198239 run : make run-state-transition-tests
199240 ef-tests-ubuntu :
200241 name : ef-tests-ubuntu
242+ needs : [check-labels]
243+ if : needs.check-labels.outputs.skip_ci != 'true'
201244 # Use self-hosted runners only on the sigp repo.
202245 runs-on : ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "small"]') || 'ubuntu-latest' }}
203246 env :
@@ -218,6 +261,8 @@ jobs:
218261 run : sccache --show-stats
219262 dockerfile-ubuntu :
220263 name : dockerfile-ubuntu
264+ needs : [check-labels]
265+ if : needs.check-labels.outputs.skip_ci != 'true'
221266 runs-on : ubuntu-latest
222267 steps :
223268 - uses : actions/checkout@v4
@@ -227,6 +272,8 @@ jobs:
227272 run : docker run -t lighthouse:local lighthouse --version
228273 basic-simulator-ubuntu :
229274 name : basic-simulator-ubuntu
275+ needs : [check-labels]
276+ if : needs.check-labels.outputs.skip_ci != 'true'
230277 runs-on : ubuntu-latest
231278 steps :
232279 - uses : actions/checkout@v4
@@ -239,6 +286,8 @@ jobs:
239286 run : cargo run --release --bin simulator basic-sim
240287 fallback-simulator-ubuntu :
241288 name : fallback-simulator-ubuntu
289+ needs : [check-labels]
290+ if : needs.check-labels.outputs.skip_ci != 'true'
242291 runs-on : ubuntu-latest
243292 steps :
244293 - uses : actions/checkout@v4
@@ -251,6 +300,8 @@ jobs:
251300 run : cargo run --release --bin simulator fallback-sim
252301 doppelganger-protection-test :
253302 name : doppelganger-protection-test
303+ needs : [check-labels]
304+ if : needs.check-labels.outputs.skip_ci != 'true'
254305 runs-on : ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "small"]') || 'ubuntu-latest' }}
255306 env :
256307 # Enable portable to prevent issues with caching `blst` for the wrong CPU type
@@ -285,6 +336,8 @@ jobs:
285336 ./doppelganger_protection.sh success genesis.json
286337 execution-engine-integration-ubuntu :
287338 name : execution-engine-integration-ubuntu
339+ needs : [check-labels]
340+ if : needs.check-labels.outputs.skip_ci != 'true'
288341 runs-on : ${{ github.repository == 'sigp/lighthouse' && fromJson('["self-hosted", "linux", "CI", "small"]') || 'ubuntu-latest' }}
289342 steps :
290343 - uses : actions/checkout@v4
@@ -344,6 +397,8 @@ jobs:
344397 run : cargo check --workspace
345398 cargo-udeps :
346399 name : cargo-udeps
400+ needs : [check-labels]
401+ if : needs.check-labels.outputs.skip_ci != 'true'
347402 runs-on : ubuntu-latest
348403 steps :
349404 - uses : actions/checkout@v4
@@ -366,6 +421,8 @@ jobs:
366421 RUSTFLAGS : " "
367422 compile-with-beta-compiler :
368423 name : compile-with-beta-compiler
424+ needs : [check-labels]
425+ if : needs.check-labels.outputs.skip_ci != 'true'
369426 runs-on : ubuntu-latest
370427 steps :
371428 - uses : actions/checkout@v4
@@ -377,6 +434,8 @@ jobs:
377434 run : make
378435 cli-check :
379436 name : cli-check
437+ needs : [check-labels]
438+ if : needs.check-labels.outputs.skip_ci != 'true'
380439 runs-on : ubuntu-latest
381440 steps :
382441 - uses : actions/checkout@v4
@@ -391,8 +450,10 @@ jobs:
391450 # a PR is safe to merge. New jobs should be added here.
392451 test-suite-success :
393452 name : test-suite-success
453+ if : needs.check-labels.outputs.skip_ci != 'true'
394454 runs-on : ubuntu-latest
395455 needs : [
456+ ' check-labels' ,
396457 ' target-branch-check' ,
397458 ' release-tests-ubuntu' ,
398459 ' release-tests-windows' ,
0 commit comments