-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
task#64: add code coverage with jacoco in action pipeline
- Loading branch information
1 parent
77694f9
commit 3294afd
Showing
3 changed files
with
56 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,6 @@ jobs: | |
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 21 | ||
|
@@ -30,3 +29,27 @@ jobs: | |
cache: maven | ||
- name: Build with Maven and tests | ||
run: mvn -B package --file pom.xml | ||
- name: Generate JaCoCo Badge | ||
id: jacoco | ||
uses: cicirello/jacoco-badge-generator@v2 | ||
with: | ||
generate-branches-badge: true | ||
jacoco-csv-file: > | ||
domain/target/site/jacoco/jacoco.csv | ||
application/target/site/jacoco/jacoco.csv | ||
client/target/site/jacoco/jacoco.csv | ||
- name: Log coverage percentage | ||
run: | | ||
echo "coverage = ${{ steps.jacoco.outputs.coverage }}" | ||
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" | ||
- name: Commit the badge (if it changed) | ||
run: | | ||
if [[ `git status --porcelain` ]]; then | ||
git config --global user.name 'YOUR NAME HERE' | ||
git config --global user.email '[email protected]' | ||
git add -A | ||
git commit -m "Autogenerated JaCoCo coverage badge" | ||
git push | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters