-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Push updated jacoco badge to badge* branch on pushes (#755)
* Push updated jacoco badge to badge* branch on pushes * Correct branch name * Remove the badge_branch parameter from gradle_main.yml so that checks can run
- Loading branch information
Showing
3 changed files
with
27 additions
and
2 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 |
---|---|---|
|
@@ -11,6 +11,12 @@ on: | |
default: main | ||
required: false | ||
type: string | ||
badge_branch: | ||
description: 'The branch which contains the jacoco badge for above branch' | ||
default: badge_main | ||
required: false | ||
type: string | ||
|
||
|
||
jobs: | ||
build: | ||
|
@@ -20,7 +26,13 @@ jobs: | |
java: ['21'] | ||
name: Java ${{ matrix.Java }} build | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Checkout badges branch to a badges directory nested inside first checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ inputs.badge_branch }} | ||
path: badges | ||
- name: Setup java | ||
uses: actions/setup-java@v2 | ||
with: | ||
|
@@ -36,11 +48,23 @@ jobs: | |
id: jacoco | ||
uses: cicirello/[email protected] | ||
with: | ||
badges-directory: badges | ||
jacoco-csv-file: build/reports/jacoco/test/jacocoTestReport.csv | ||
- name: Log coverage percentage | ||
run: | | ||
echo "coverage = ${{ steps.jacoco.outputs.coverage }}" | ||
echo "branch coverage = ${{ steps.jacoco.outputs.branches }}" | ||
- name: Commit and push badge | ||
if: ${{ github.event_name != 'pull_request' }} | ||
run: | | ||
cd badges | ||
if [[ `git status --porcelain *.svg` ]]; then | ||
git config --global user.name github_actions | ||
git add *.svg | ||
git commit -m "Autogenerated JaCoCo coverage badge" *.svg | ||
git push | ||
fi | ||
cd .. | ||
- name: Upload JaCoCo coverage report | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ jobs: | |
uses: Yelp/nrtsearch/.github/workflows/[email protected] | ||
with: | ||
branch: v0.x | ||
badge_branch: badge_v0.x |