From 17425b1564466c58eda085e9e91399a6bdeced34 Mon Sep 17 00:00:00 2001 From: Robin Salkeld Date: Tue, 3 Sep 2024 13:56:49 -0700 Subject: [PATCH] chore(ci): make all pull.yml jobs required in branch protection automatically (#554) As is the case for many suites of GitHub actions, it's a huge pain to manually maintain the list of required checks in the branch protection. This change leverages https://github.com/re-actors/alls-green to add a single capstone action that only passes if all dependent jobs pass (see repo README for details on why the naive approach doesn't work). Once this is approved I'll update the required checks before merging. Also adding Python tests to the list of triggers in the nightly build since I noticed it was missing. --- .github/workflows/nightly_dafny.yml | 1 + .github/workflows/pull.yml | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/.github/workflows/nightly_dafny.yml b/.github/workflows/nightly_dafny.yml index 4edb7ab15..20b5baa2b 100644 --- a/.github/workflows/nightly_dafny.yml +++ b/.github/workflows/nightly_dafny.yml @@ -50,6 +50,7 @@ jobs: dafny-nightly-java, dafny-nightly-net, dafny-nightly-rust, + dafny-nightly-python, ] if: ${{ always() && contains(needs.*.result, 'failure') }} env: diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 7ee82eede..31e2db4db 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -66,3 +66,18 @@ jobs: uses: ./.github/workflows/test_models_python_tests.yml with: dafny: ${{ matrix.dafny-version }} + + pr-ci-all-required: + if: always() + needs: + - pr-ci-verification + - pr-ci-java + - pr-ci-net + - pr-ci-rust + - pr-ci-python + runs-on: ubuntu-latest + steps: + - name: Verify all required jobs passed + uses: re-actors/alls-green@release/v1 + with: + jobs: ${{ toJSON(needs) }}