Skip to content

Commit

Permalink
ci: add JaCoCo code coverage check
Browse files Browse the repository at this point in the history
  • Loading branch information
phmz committed May 22, 2024
1 parent 6473127 commit 548c4de
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Test & Coverage
on:
pull_request:
branches:
- '*'

jobs:
test-and-coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Set up the Maven dependencies caching
uses: actions/cache@v3
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Run tests
run: mvn --batch-mode --update-snapshots verify -Dgpg.skip=true

- name: Add coverage
uses: madrapps/[email protected]
with:
paths: |
${{ github.workspace }}/**/target/site/jacoco/jacoco.xml
token: ${{ secrets.GITHUB_TOKEN }}
title: '### :zap: Coverage report'
update-comment: true
min-coverage-overall: 80
min-coverage-changed-files: 60
continue-on-error: false

0 comments on commit 548c4de

Please sign in to comment.