Skip to content

Commit

Permalink
Fix workflow marked as failed despite "continue-on-error" enabled
Browse files Browse the repository at this point in the history
When "continue-on-error" is set at the job's level, the entire workflow
wont be considered as "failed" per se. However, the icon associated with
a commit will still be a red cross mark "X". This is confusing, this
could incorrectly suggest that the build has failed.

By putting "continue-on-error" at the step's level, the job and
therefore the full workflow will be marked as succeeded. This is
preferable, even if it makes problems less noticeable.
  • Loading branch information
Delgan committed Oct 20, 2024
1 parent 46fd1b3 commit 4207040
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ jobs:
- '3.11'
- '3.12'
- '3.13'
- 3.14-dev
- pypy-3.10
include:
- os: ubuntu-20.04
Expand All @@ -33,8 +32,10 @@ jobs:
python-version: '3.12'
- os: macos-13
python-version: '3.12'
- os: ubuntu-22.04
python-version: 3.14-dev
allow-failure: true
runs-on: ${{ matrix.os }}
continue-on-error: ${{ endsWith(matrix.python-version, '-dev') }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -52,10 +53,12 @@ jobs:
- name: Run tests
run: |
tox -e tests
continue-on-error: ${{ matrix.allow-failure }}
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
flags: ${{ matrix.os }}_${{ matrix.python-version }}
verbose: true
fail_ci_if_error: true
continue-on-error: ${{ matrix.allow-failure }}

0 comments on commit 4207040

Please sign in to comment.