-
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
153 additions
and
66 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: maven jacoco | ||
|
||
on: | ||
push: | ||
branches-ignore: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
maven: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
include: | ||
- java-version: "17" | ||
java-distribution: "temurin" | ||
senzingapi-runtime-version: "staging-v4" | ||
|
||
steps: | ||
- name: checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: actions/setup-java@v4 | ||
with: | ||
java-version: ${{ matrix.java-version }} | ||
distribution: ${{ matrix.java-distribution }} | ||
|
||
- name: install Senzing API | ||
uses: senzing-factory/github-action-install-senzing-api@v3 | ||
with: | ||
senzingapi-runtime-version: ${{ matrix.senzingapi-runtime-version }} | ||
|
||
- name: Build with Maven | ||
run: | | ||
# temp skip checkstyle and spotbugs to verify coverage | ||
# -Dmaven.test.failure.ignore=true | ||
mvn clean install -B -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn -Popenclover -Dsenzing.support.dir="/opt/senzing/data" | ||
ls ${{ github.workspace }}/target | ||
ls ${{ github.workspace }}/target/site/clover | ||
grep -Ril *.xml target | ||
- uses: danhunsaker/clover-reporter-action@v0.2.17-clover | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
clover-file: ./coverage/clover.xml | ||
|
||
- name: Fail PR if overall coverage is less than 80% | ||
if: ${{ steps.jacoco.outputs.coverage-overall < 80.0 }} | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
core.setFailed('Overall coverage is less than 80%!') |
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