Skip to content

Commit

Permalink
doc: Making check results look green
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <git@lecris.dev>
  • Loading branch information
LecrisUT committed Dec 26, 2023
1 parent 223e4bb commit fb3e20d
Showing 1 changed file with 39 additions and 0 deletions.
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/github/docs/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`] 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 @@ -210,6 +246,7 @@ The contents of this project is released under the
[BSD 3-clause license].


[`steps[*].continue-on-error`]: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error
[aiohttp]: https://github.com/aio-libs/aiohttp
[Ansible]: https://github.com/ansible
[Ansible Collections]: https://github.com/ansible-collections
Expand All @@ -218,6 +255,7 @@ 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
[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

0 comments on commit fb3e20d

Please sign in to comment.