From 75caa09c992b861d9234c476359ba384e35d2b63 Mon Sep 17 00:00:00 2001 From: Quentin Monnet Date: Tue, 3 Dec 2024 13:34:21 +0000 Subject: [PATCH] Revert "ci: Remove summary steps" This reverts commit 6d69a4e55096fd1034d361d6f584c098b5853dea. I thought we could have the individual jobs marked as required. But we hit the following issue: Individual jobs (build, test, push in dev.yml and sterile.yml) use a matrix to run with multiple Rust toolchains (stable/nightly). The Rust toolchain appears in the job name, whether we specify it or not. Then when trying to fill the list of required checks in GitHub's interface, we've got to use these names and as far as I can tell this must be an exact match, so we need to specify the toolchain. So far this looks good because ideally we'd like to have the checks using the stable toolchain, not nightly, as required. However, when the job is skipped, because no relevant files are touched in the Pull Request, the matrix is not generated, and the toolchain name is not appended to the job name as one might expect. In such a case, it's no longer possible to match the required checks with the titles of the status checks for the Pull Request, and the Pull Request is blocked. Let's re-add the summaries so we can mark them as required. Signed-off-by: Quentin Monnet --- .github/workflows/dev.yml | 13 +++++++++++++ .github/workflows/sterile.yml | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 93c329d..308a3c1 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -175,3 +175,16 @@ jobs: timeout-minutes: 60 with: limit-access-to-actor: true + + summary: + name: "summary" + runs-on: "ubuntu-latest" + needs: + - build + if: ${{ always() && needs.build.result != 'skipped' }} + steps: + - name: "Flag any build matrix failures" + if: ${{ needs.build.result != 'success' }} + run: | + >&2 echo "A critical step failed!" + exit 1 diff --git a/.github/workflows/sterile.yml b/.github/workflows/sterile.yml index 44364ca..a47a47d 100644 --- a/.github/workflows/sterile.yml +++ b/.github/workflows/sterile.yml @@ -229,3 +229,22 @@ jobs: timeout-minutes: 60 with: limit-access-to-actor: true + + summary: + name: "summary" + runs-on: "ubuntu-latest" + needs: + - test + - push + if: ${{ always() && needs.test.result != 'skipped' && needs.push.result != 'skipped' }} + steps: + - name: "Flag any test failures" + if: ${{ needs.test.result != 'success' }} + run: | + >&2 echo "One or more required tests failed" + exit 1 + - name: "Flag any push failures" + if: ${{ needs.push.result != 'success' }} + run: | + >&2 echo "One or more required pushes failed" + exit 1