# Ignoring nightly failure for CI badge

**URL:** <https://discourse.julialang.org/t/ignoring-nightly-failure-for-ci-badge/98028>\
**Category:** Package Management\
**Tags:** testing, ci, github-actions\
**Created:** [April 28, 2023, 8:42am UTC](https://discourse.julialang.org/t/ignoring-nightly-failure-for-ci-badge/98028 "2023-04-28T08:42:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [April 28, 2023, 8:42am UTC](https://discourse.julialang.org/t/ignoring-nightly-failure-for-ci-badge/98028/1 "2023-04-28T08:42:25Z")

</div>

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](https://github.com/JuliaSmoothOptimizers/SolverTest.jl/pull/6), credits to @kristoffer.carlsson :

```yaml
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

```

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [April 28, 2023, 9:10am UTC](https://discourse.julialang.org/t/ignoring-nightly-failure-for-ci-badge/98028/3 "2023-04-28T09:10:59Z")

</div>

For completeness, we use

> <https://github.com/JuliaManifolds/Manifolds.jl/blob/master/.github/workflows/ci.yml>

and

> <https://github.com/JuliaManifolds/Manifolds.jl/blob/master/.github/workflows/nightly.yml>

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

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [September 21, 2023, 7:53pm UTC](https://discourse.julialang.org/t/ignoring-nightly-failure-for-ci-badge/98028/5 "2023-09-21T19:53:44Z")

</div>

Edit: I forgot to copypaste one crucial line:

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

```

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

> **[Workflow syntax for GitHub Actions - GitHub Docs](https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-preventing-a-specific-failing-matrix-job-from-failing-a-workflow-run)**
>
> A workflow is a configurable automated process made up of one or more jobs. You must create a YAML file to define your workflow configuration.
