Ignoring nightly failure for CI badge

Not a question, just saving this here before the Slack black hole swallows it.
There are ways to ignore the (possibly frequent) nightly failures in the “CI: passing / failing” badge:

  • having 2 GitHub actions, one for CI used in the badge, and one for nightly, credits to @kellertuer
  • modifying the workflow to something like this, credits to @kristoffer.carlsson :
jobs:
  test:
    name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        version: ['1.7', '1']
        os: [ubuntu-latest]
        arch: [x64]
        allow_failure: [false]
        include:
          - version: 'nightly'
            os: ubuntu-latest
            arch: x64
            allow_failure: true
3 Likes

For completeness, we use

and

Only the first one is used for the CI badge in the readme. On PR, of course, all are run.

1 Like

Edit: I forgot to copypaste one crucial line:

runs-on: ...
continue-on-error: ${{ matrix.allow_failure }}
stragegy: ...

Same trick as in the GitHub Actions doc, where they use experimental instead: