Skip to content

Commit 0865e3a

Browse files
committed
Fix premature Codecov status checks
Restructure workflow so Test and Acceptance jobs save coverage as artifacts, then a new Upload job waits for both to complete before uploading all reports together, ensuring Codecov receives complete data in a single batch instead of calculating status prematurely. Ref: https://issues.redhat.com/browse/EC-1591 Assisted-by: Claude
1 parent dc0574d commit 0865e3a

File tree

1 file changed

+66
-27
lines changed

1 file changed

+66
-27
lines changed

.github/workflows/checks-codecov.yaml

Lines changed: 66 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -85,32 +85,15 @@ jobs:
8585
- name: Test
8686
run: make test
8787

88-
- name: Upload unit test coverage report
89-
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
90-
env:
91-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
92-
with:
93-
files: ./coverage-unit.out
94-
disable_search: true
95-
flags: unit
96-
97-
- name: Upload generative test coverage report
98-
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
99-
env:
100-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
101-
with:
102-
files: ./coverage-generative.out
103-
disable_search: true
104-
flags: generative
105-
106-
- name: Upload integration test coverage report
107-
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
108-
env:
109-
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
88+
- name: Upload test coverage artifacts
89+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.0
11090
with:
111-
files: ./coverage-integration.out
112-
disable_search: true
113-
flags: integration
91+
name: coverage-test
92+
path: |
93+
./coverage-unit.out
94+
./coverage-generative.out
95+
./coverage-integration.out
96+
retention-days: 1
11497

11598
Acceptance:
11699
runs-on: ubuntu-latest
@@ -149,12 +132,68 @@ jobs:
149132
id: acceptance_test
150133
run: E2E_INSTRUMENTATION=true make acceptance
151134

152-
- name: Upload coverage report
135+
- name: Upload acceptance coverage artifact
136+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.0
137+
with:
138+
name: coverage-acceptance
139+
path: ./coverage-acceptance.out
140+
retention-days: 1
141+
142+
Upload Coverage Statistics:
143+
runs-on: ubuntu-latest
144+
needs: [Test, Acceptance]
145+
steps:
146+
- name: Harden Runner
147+
uses: step-security/harden-runner@c6295a65d1254861815972266d5933fd6e532bdf # v2.11.1
148+
with:
149+
egress-policy: audit
150+
disable-telemetry: true
151+
152+
- name: Download test coverage artifacts
153+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
154+
with:
155+
name: coverage-test
156+
path: ./coverage
157+
158+
- name: Download acceptance coverage artifact
159+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
160+
with:
161+
name: coverage-acceptance
162+
path: ./coverage
163+
164+
- name: Upload unit test coverage report
165+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
166+
env:
167+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
168+
with:
169+
files: ./coverage/coverage-unit.out
170+
disable_search: true
171+
flags: unit
172+
173+
- name: Upload generative test coverage report
174+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
175+
env:
176+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
177+
with:
178+
files: ./coverage/coverage-generative.out
179+
disable_search: true
180+
flags: generative
181+
182+
- name: Upload integration test coverage report
183+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
184+
env:
185+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
186+
with:
187+
files: ./coverage/coverage-integration.out
188+
disable_search: true
189+
flags: integration
190+
191+
- name: Upload acceptance test coverage report
153192
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
154193
env:
155194
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
156195
with:
157-
files: ./coverage-acceptance.out
196+
files: ./coverage/coverage-acceptance.out
158197
disable_search: true
159198
flags: acceptance
160199

0 commit comments

Comments
 (0)