Skip to content

Commit 7f05f8c

Browse files
committed
Only upload coverage when success
1 parent bb7993b commit 7f05f8c

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/run-integration-tests.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
7070
# Replace '/' with '-'
7171
- name: Normalize project name
72+
if: ${{ !cancelled() }}
7273
env:
7374
PROJECT: ${{ matrix.project }}
7475
run: echo PROJECT_NORMALIZED=${PROJECT/\//-} >> $GITHUB_ENV
@@ -82,21 +83,21 @@ jobs:
8283
if-no-files-found: ignore
8384

8485
- name: Aggregate WebApp JaCoCo report
85-
if: ${{ matrix.jacoco && !cancelled() }}
86+
if: ${{ matrix.jacoco && success() }}
8687
# Important: Also run compile (if not already done) so that we have all class files - otherwise the report will be incomplete
8788
run: |
8889
./mvnw -B compile jacoco-aggregator:report-aggregate-all -pl "advanced-demo/webapp" -am -T2C
8990
9091
- name: Upload WebApp JaCoCo report
91-
if: ${{ matrix.jacoco && !cancelled() }}
92+
if: ${{ matrix.jacoco && success() }}
9293
uses: actions/upload-artifact@v6
9394
with:
9495
name: webapp-jacoco-report-${{ matrix.java }}-${{ env.PROJECT_NORMALIZED }}-${{ matrix.parallel }}-${{ matrix.pre-start }}
9596
path: advanced-demo/target/site/jacoco-aggregate
9697
if-no-files-found: ignore
9798

9899
- name: WebApp JaCoCo Code Coverage Report
99-
if: ${{ matrix.jacoco && !cancelled() }}
100+
if: ${{ matrix.jacoco && success() }}
100101
id: jacoco_reporter
101102
uses: PavanMudigonda/jacoco-reporter@4fc6bf270fe893e8dda5467e432253a6961345b8 # v5.0
102103
with:
@@ -106,7 +107,7 @@ jobs:
106107
github_token: ${{ secrets.GITHUB_TOKEN }}
107108

108109
- name: Add WebApp JaCoCo report to workflow run summary
109-
if: ${{ matrix.jacoco && !cancelled() }}
110+
if: ${{ matrix.jacoco && success() }}
110111
run: |
111112
echo "| Outcome | Value |" >> $GITHUB_STEP_SUMMARY
112113
echo "| --- | --- |" >> $GITHUB_STEP_SUMMARY

0 commit comments

Comments
 (0)