Skip to content

Commit

Permalink
Revert "ci: Remove summary steps"
Browse files Browse the repository at this point in the history
This reverts commit 6d69a4e.

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 <[email protected]>
  • Loading branch information
qmonnet committed Dec 3, 2024
1 parent 2ae0fac commit 75caa09
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 19 additions & 0 deletions .github/workflows/sterile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 75caa09

Please sign in to comment.