Skip to content

Commit cd02d9f

Browse files
Allow base_coverage job to fail
If there is a problem on master then base_coverage will never pass meaning that coverage will never be run.
1 parent bc19385 commit cd02d9f

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

.github/workflows/test.yml

+18-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ on:
55

66
jobs:
77
base_coverage:
8+
continue-on-error: true
89
runs-on: ubuntu-latest
910
steps:
1011
- uses: actions/checkout@v3
@@ -111,11 +112,16 @@ jobs:
111112
name: coverage-3.12
112113

113114
- name: Download code coverage report for base branch
115+
id: download-base-coverage
116+
continue-on-error: true
114117
uses: actions/download-artifact@v4
115118
with:
116119
name: base-coverage.lcov
117120

118121
- name: Generate Code Coverage report
122+
# Note, due to continue on error (to make job pass) we need to check the
123+
# Status of the step directly not just use success() or failure()
124+
if: steps.download-base-coverage.outcome == 'success'
119125
id: code-coverage
120126
uses: barecheck/code-coverage-action@v1
121127
with:
@@ -124,4 +130,15 @@ jobs:
124130
base-lcov-file: "./base-coverage.lcov"
125131
minimum-ratio: 0
126132
send-summary-comment: true
127-
show-annotations: "warning"
133+
show-annotations: "warning"
134+
135+
- name: Generate Code Coverage report if base job fails
136+
if: steps.download-base-coverage.outcome == 'failure'
137+
id: code-coverage-without-base
138+
uses: barecheck/code-coverage-action@v1
139+
with:
140+
barecheck-github-app-token: ${{ secrets.BARECHECK_GITHUB_APP_TOKEN }}
141+
lcov-file: "./coverage.lcov"
142+
minimum-ratio: 0
143+
send-summary-comment: true
144+
show-annotations: "warning"

0 commit comments

Comments
 (0)