Skip to content

Commit cf5bf50

Browse files
justinchubyCopilot
andcommitted
ci: gate golden-comparison codecov upload on has_golden condition
When golden test data is absent, the test step is skipped, leaving no coverage.xml or golden-results.xml. The codecov upload steps now use the same `steps.check_golden.outputs.has_golden == 'true'` guard as the test step so they are skipped rather than failing or uploading nothing. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
1 parent 150008d commit cf5bf50

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,13 @@ jobs:
233233
--junitxml golden-results.xml
234234
timeout-minutes: 30
235235
- name: Upload coverage to Codecov
236-
if: always()
236+
if: steps.check_golden.outputs.has_golden == 'true'
237237
uses: codecov/codecov-action@v6
238238
with:
239239
token: ${{ secrets.CODECOV_TOKEN }}
240240
flags: golden
241241
- name: Upload test results to Codecov
242-
if: ${{ !cancelled() }}
242+
if: steps.check_golden.outputs.has_golden == 'true' && !cancelled()
243243
uses: codecov/codecov-action@v6
244244
with:
245245
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)