Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: Making check results look green #27

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ Whether this check decided that the job matrix succeeded.

## Gotchas

### Experimental matrix jobs

An attentive reader may have noticed that there is no clear way to
allow failures for specific job generated by matrixes in a simple
manner, through action inputs. This is due to the fact that those
Expand Down Expand Up @@ -174,6 +176,40 @@ jobs:
...
```

### Displaying the overall workflow result

The GitHub commit and pull-request checks will still display as if the workflows
have failed (the red cross on the checks). To clarify the actual status of the
workflow taking into account [experimental matrix jobs] and `allowed-failures`
you can do two things:

#### Display the workflow badge

See the [github documentation][workflow-badge-doc] about how to include the
workflow status on the top-level README page. Simply point this to the workflow
that runs the alls-green action, e.g.:
```markdown
![CI-status](https://github.com/user/repo/actions/workflows/ci.yml/badge.svg?branch=main&event=push)
```

#### Masking the check results

If you know the exact step that may fail, you can use
[`steps[*].continue-on-error`][continue-on-error] to mask the job's result, e.g.:
```yaml
jobs:
tests:
runs-on: ubuntu-latest
matrix:
python-version: [ "3.11", "3.x" ]
includes:
- python-version: "3.x"
experimental: true
steps:
- uses: actions/checkout@v5
- runs: do-test
continue-on-error: ${{ github.event_name == 'push' && matrix.experimental}}
```

## Does anybody actually use this?

Expand Down Expand Up @@ -218,6 +254,8 @@ The contents of this project is released under the
[BSD 3-clause license]: LICENSE.md
[conda]: https://github.com/conda/conda
[coveragepy]: https://github.com/nedbat/coveragepy
[continue-on-error]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error
[experimental matrix jobs]: #experimental-matrix-jobs
[forum:check]:
https://github.com/orgs/community/discussions/26733#discussioncomment-3253151
[gating]: https://gating.dev
Expand All @@ -228,6 +266,7 @@ https://github.com/orgs/community/discussions/26733#discussioncomment-3253151
[spaceship-prompt]: https://github.com/spaceship-prompt/spaceship-prompt
[structlog]: https://github.com/hynek/structlog
[Towncrier]: https://github.com/twisted/towncrier
[workflow-badge-doc]: https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/adding-a-workflow-status-badge
[Zuul]: https://zuul-ci.org
[@aio-libs]: https://github.com/aio-libs
[@CherryPy]: https://github.com/cherrypy
Expand Down