Skip to content

Commit

Permalink
Make optional step failure more visible
Browse files Browse the repository at this point in the history
The prior strategy made nightly an optional step, but I think we should be a little more noisy about it than a green check with a tiny warning would suggest.

Signed-off-by: Daniel Noland <daniel@githedgehog.com>
  • Loading branch information
daniel-noland committed Feb 7, 2025
1 parent 6627f32 commit 0d630ec
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ jobs:
build:
needs: [ check_changes ]
if: "${{ needs.check_changes.outputs.devfiles == 'true' }}"
permissions:
issues: "write"
pull-requests: "write"
contents: "write"
id-token: "write"
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -180,6 +185,22 @@ jobs:
printf "::notice::HEAD remains at %s\n" "$(git log --oneline --no-decorate -n 1)"
continue-on-error: ${{ matrix.rust.optional }}

- name: "Note failure of optional steps"
uses: "actions/github-script@v7"
if: ${{ matrix.rust.optional && (steps.gnu_dev_test.outcome != 'success' || steps.musl_dev_test.outcome != 'success' || steps.gnu_release_test.outcome != 'success' || steps.musl_release_test.outcome != 'success' || steps.clippy.outcome != 'success') }}
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
script: |
let body = "### :warning: One or more optional CI steps have failed!\n\n";
body += "_[click here to lament thy folly](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})_"
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: body
});
- name: "Setup tmate session for debug"
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: "mxschmitt/action-tmate@v3"
Expand Down

0 comments on commit 0d630ec

Please sign in to comment.