-
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.
- Loading branch information
Showing
2 changed files
with
24 additions
and
12 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 |
---|---|---|
|
@@ -22,22 +22,34 @@ jobs: | |
- name: Build with Maven | ||
run: mvn -B clean install | ||
|
||
- name: Generate JaCoCo Badge | ||
- name: Generate Jacoco Badge | ||
id: jacoco | ||
uses: cicirello/jacoco-badge-generator@v2 | ||
with: | ||
generate-branches-badge: true | ||
|
||
- name: setup git config | ||
- name: Log coverage percentage | ||
run: | | ||
git config user.name "GitHub Actions Bot" | ||
git config user.email "<>" | ||
echo "coverage = ${{ steps.jacoco.outputs.coverage }}" | ||
echo "branches = ${{ steps.jacoco.outputs.branches }}" | ||
- name: commit | ||
- name: Commit and push | ||
if: ${{ github.event_name != 'pull_request' }} | ||
run: | | ||
# Stage the file, commit and push | ||
git add . | ||
git commit -m "coverage badge" | ||
git push origin main | ||
cd .github/badges | ||
if [[ `git status --porcelain *.svg` ]]; then | ||
git config --global user.name 'github-actions' | ||
git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
git add *.svg | ||
git commit -m "Autogenerated JaCoCo coverage badge" *.svg | ||
git push | ||
fi | ||
- name: Upload Jacoco coverage report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: jacoco-report | ||
path: target/site/jacoco/ | ||
|
||
- name: Codecov | ||
uses: codecov/[email protected] |
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