Skip to content

Commit 9ac328e

Browse files
committed
Introduce a gate/check GHA job
This adds a GHA job that reliably determines if all the required dependencies have succeeded or not. It also allows to reduce the list of required branch protection CI statuses to just one — `check`. This reduces the maintenance burden by a lot and have been battle-tested across a small bunch of projects in its action form and in-house implementations of other people. This action is now in use in aiohttp (and other aio-libs projects), CherryPy, conda, coveragepy, Open edX, Towncrier some of the Ansible repositories, pip-tools, all of the jaraco's projects (like `setuptools`, `importlib_metadata`), some of hynek's projects (like `attrs`, `structlog`), some PyCQA, PyCA, PyPA and pytest projects, a few AWS Labs projects. Admittedly, I maintain a few of these but it seems to address some of the pain folks have: jaraco/skeleton#55 (comment). I figured, this might be useful for CPython too, which is why I'm submitting this patch. The story behind this is explained in more detail at https://github.com/marketplace/actions/alls-green#why.
1 parent a3a5b4b commit 9ac328e

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

.github/workflows/build.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ jobs:
123123
timeout-minutes: 60
124124
needs: check_source
125125
if: needs.check_source.outputs.run_tests == 'true'
126+
continue-on-error: true
126127
env:
127128
IncludeUwp: 'true'
128129
steps:
@@ -159,6 +160,7 @@ jobs:
159160
timeout-minutes: 60
160161
needs: check_source
161162
if: needs.check_source.outputs.run_tests == 'true'
163+
continue-on-error: true
162164
env:
163165
HOMEBREW_NO_ANALYTICS: 1
164166
HOMEBREW_NO_AUTO_UPDATE: 1
@@ -248,6 +250,7 @@ jobs:
248250
timeout-minutes: 60
249251
needs: check_source
250252
if: needs.check_source.outputs.run_tests == 'true'
253+
continue-on-error: true
251254
strategy:
252255
fail-fast: false
253256
matrix:
@@ -339,3 +342,38 @@ jobs:
339342
run: make pythoninfo
340343
- name: Tests
341344
run: xvfb-run make buildbottest TESTOPTS="-j4 -uall,-cpu"
345+
346+
check: # This job does nothing and is only used for the branch protection
347+
if: always()
348+
349+
needs:
350+
- check_source # Transitive dependency, needed to access `run_tests` value
351+
- check_generated_files
352+
- build_win32
353+
- build_win_amd64
354+
- build_macos
355+
- build_ubuntu
356+
- build_ubuntu_ssltests
357+
- build_asan
358+
359+
runs-on: ubuntu-latest
360+
361+
steps:
362+
- name: Decide whether the needed jobs succeeded or failed
363+
uses: re-actors/alls-green@13b4244b312e8a314951e03958a2f91519a6a3c9
364+
with:
365+
allowed-skips: >-
366+
${{
367+
needs.check_source.outputs.run_tests == 'true'
368+
&& '
369+
check_generated_files,
370+
build_win32,
371+
build_win_amd64,
372+
build_macos,
373+
build_ubuntu,
374+
build_ubuntu_ssltests,
375+
build_asan,
376+
'
377+
|| ''
378+
}}
379+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)