Skip to content

Commit 77953eb

Browse files
lukeshinglesclaude
andcommitted
Publish coverage even when a matrix leg is red
needs.tests.result is the aggregate over the legs, so one failing set took the whole report down - on exactly the PR whose reader change you wanted to see covered, since a checksum shift is the usual way a leg goes red. Require only pytest, and keep needs on the matrix so the artifacts that did upload are there to combine. Naming a status function is what disables the implicit success() over all of needs. A failed leg uploads nothing, so the number is lower on those runs; the comment says to read it alongside the matrix rather than as a regression. Checked the degenerate case: with only the pytest data file, combine, xml and report all succeed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 65ad9e1 commit 77953eb

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/test.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,14 @@ jobs:
9797

9898

9999
upload-coverage-python:
100-
# an if: with no status function implies success(), so this runs only when pytest and every
101-
# matrix leg passed. That is deliberate: a leg that failed uploaded no data, and publishing
102-
# the combine of what remains would report a coverage drop that is an artifact of the
103-
# failure rather than a real regression.
100+
# needs the matrix so the artifacts exist, but requires only pytest to have passed: a single
101+
# red leg would otherwise take the whole report down, on exactly the PR whose reader change
102+
# you want to see covered. A failed leg uploads nothing, so the number is then lower than a
103+
# green run's - read it alongside the matrix, not as a regression on its own.
104+
# naming a status function here is what disables the implicit success() over all of needs.
104105
needs: [pytest, tests]
105-
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository
106+
if: ${{ !cancelled() && needs.pytest.result == 'success' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name
107+
== github.repository) }}
106108
runs-on: ubuntu-latest
107109
permissions:
108110
contents: read

0 commit comments

Comments
 (0)