File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 70
70
name : coverage-report
71
71
if-no-files-found : error
72
72
path : build/reports/jacoco/test/
73
+
74
+ # Experiment if GitHub automatically shows coverage directly for run result
75
+ - name : Show coverage in GitHub action run result page
76
+ uses : actions/upload-artifact@v4
77
+ with :
78
+ name : jacoco-summary
79
+ if-no-files-found : error
80
+ path : build/reports/jacoco/test/jacocoTestReport.csv
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ run-with-gradle:
22
22
SAVE ARTIFACT --keep-ts build/reports/jacoco/test/ AS LOCAL build/reports/jacoco/test/
23
23
# Javadocs and jars
24
24
SAVE ARTIFACT --keep-ts build/libs/modern-java-practices-0-javadoc.jar
25
- SAVE ARTIFACT --keep-ts build/docs/javadoc/ AS LOCAL build/docs/javadoc/
25
+ SAVE ARTIFACT --keep-ts build/docs/javadoc/test/ AS LOCAL build/docs/javadoc/test /
26
26
27
27
# Test coverage and badge for Gradle:
28
28
# You need to PICK ONE from Gradle or Maven for your build.
@@ -32,7 +32,9 @@ run-with-gradle:
32
32
# Gradle.
33
33
# After this enabling this, you still need to update the GitHub action steps
34
34
# to generate the badge using a custom path to the CVS report.
35
- # SAVE ARTIFACT --save-ts build/reports/jacoco/test/jacocoTestReport.csv AS LOCAL build/reports/jacoco/test/jacocoTestReport.csv
35
+ SAVE ARTIFACT --save-ts build/reports/jacoco/test/jacocoTestReport.csv AS LOCAL build/reports/jacoco/test/jacocoTestReport.csv
36
+ # Experiment if GitHub shows test coverage from these reports:
37
+ SAVE ARTIFACT --keep-ts build/reports/jacoco/test/jacocoTestReport.csv build/reports/jacoco/test/jacocoTestReport.csv
36
38
37
39
build-with-maven :
38
40
COPY mvnw .
@@ -55,6 +57,9 @@ build-with-maven:
55
57
# See above comments on enabling for Gradle.
56
58
# Note that ONLY the Maven containerized build updates the README frontpage
57
59
# badge for coverage. This is to avoid multiple updating.
60
+ #
61
+ # ALSO NOTE: This seems to enable GitHub action to show coverage directly in
62
+ # an action build run.
58
63
SAVE ARTIFACT --keep-ts target/site/jacoco/jacoco.csv AS LOCAL target/site/jacoco/jacoco.csv
59
64
60
65
run-with-maven :
You can’t perform that action at this time.
0 commit comments