From 046c772432fd77383058769a52a0ac3df0e6aa13 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Thu, 22 Aug 2024 03:39:30 -0500 Subject: [PATCH] Add a `success` job to CI This will allow us to enable auto merge once CI completes. --- .github/workflows/main.yml | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f75a75c..bc5408d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -136,4 +136,21 @@ jobs: rustup default nightly - uses: Swatinem/rust-cache@v2 - run: cargo doc - + + success: + needs: + - clippy + - test + - cross_compile_test + - ios_cross_compile_test + - rustfmt + - doc + runs-on: ubuntu-latest + # GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency + # failed" as success. So we have to do some contortions to ensure the job fails if any of its + # dependencies fails. + if: always() # make sure this is never "skipped" + steps: + # Manually check the status of all dependencies. `if: failure()` does not work. + - name: check if any dependency failed + run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'