Skip to content

Commit 536d4a3

Browse files
committed
For #607. Work on artifacts from CI
1 parent ea8863d commit 536d4a3

File tree

2 files changed

+19
-40
lines changed

2 files changed

+19
-40
lines changed

.github/workflows/ci-earthly-gradle.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -64,34 +64,9 @@ jobs:
6464
- name: Execute run script
6565
run: earthly --secret OWASP_NVD_API_KEY +run-with-gradle
6666

67-
# TODO: Enable coverage badge for Gradle.
68-
# Note that this needs build/reports/jacoco/test/jacocoTestReport.csv
69-
# saved as an artifact for the badge to use, and some configuration of
70-
# the Cicirello badge generator.
71-
# - name: Generate coverage badge
72-
# # if: ${{ github.ref == 'refs/head/master' }}
73-
# uses: cicirello/jacoco-badge-generator@v2
74-
# with:
75-
# badges-directory: images
76-
# generate-branches-badge: false
77-
# generate-summary: false
78-
7967
- name: Save coverage report
8068
uses: actions/upload-artifact@v4
8169
with:
8270
name: coverage-report
83-
path: build/reports/jacoco/test/html
84-
85-
# Can this colide with the Maven build when both finish about the same
86-
# time?
87-
# - name: Add coverage to repo
88-
# # if: ${{ github.ref == 'refs/head/master' }}
89-
# run: |
90-
# cd images
91-
# if [[ ! -z "$(git status --porcelain *.svg)" ]]; then
92-
# git config --global user.name 'github-actions'
93-
# git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com'
94-
# git add *.svg
95-
# git commit -m 'Autogenerated coverage badge'
96-
# git push || echo "$0: Another build won for coverage badge" >&2
97-
# fi
71+
if-no-files-found: error
72+
path: build/reports/jacoco/test

.github/workflows/ci-earthly-maven.yml

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ jobs:
6464
- name: Execute run script
6565
run: earthly --secret OWASP_NVD_API_KEY +run-with-maven
6666

67-
# Javadoc HTML and jars
67+
# Save artifacts for build
6868
# See Earthfile that copies these from container to local
6969

70+
# Javadoc HTML and jars
71+
7072
- name: Save Javadoc HTML for main
7173
uses: actions/upload-artifact@v4
7274
with:
@@ -95,8 +97,18 @@ jobs:
9597
if-no-files-found: error
9698
path: target/modern-java-practices-0-SNAPSHOT-test-javadoc.jar
9799

98-
# Coverage badge and report artifact
99-
# See Earthfile that copies these from container to local
100+
# Coverage badge report
101+
102+
- name: Save coverage report
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: coverage-report
106+
if-no-files-found: error
107+
path: target/site/jacoco/
108+
109+
# Generage coverage badge for README
110+
# Gradle builds are similar but will require configuration the path for the
111+
# CSV JaCoCo report.
100112

101113
- name: Generate coverage badge
102114
# if: ${{ github.ref == 'refs/head/master' }}
@@ -106,16 +118,8 @@ jobs:
106118
generate-branches-badge: false
107119
generate-summary: false
108120

109-
- name: Save coverage report
110-
uses: actions/upload-artifact@v4
111-
with:
112-
name: coverage-report
113-
if-no-files-found: error
114-
path: target/site/jacoco/
115-
116-
# Can this colide with the Gradle build when both finish about the same
117-
# time?
118-
- name: Add coverage to repo
121+
# The saved badge does not appear when you pull code locally
122+
- name: Add coverage to CI repo
119123
# if: ${{ github.ref == 'refs/head/master' }}
120124
run: |
121125
cd images

0 commit comments

Comments
 (0)