diff --git a/.gitea/workflows/coverage-report.yaml b/.gitea/workflows/coverage-report.yaml new file mode 100644 index 0000000000..4df04e5a33 --- /dev/null +++ b/.gitea/workflows/coverage-report.yaml @@ -0,0 +1,31 @@ +name: Coverage report +on: + pull_request: + types: + - opened + - synchronize + paths: + - '**/src/**.java' + - '.gitea/workflows/coverage-report.yaml' + +jobs: + coverage-report: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Build with Maven + run: ./mvnw --batch-mode --activate-profiles coverage verify + - name: Add coverage report to pull request + uses: madrapps/jacoco-report@v1.7.1 + with: + paths: ${{ github.workspace }}/**/target/site/jacoco/jacoco.xml + token: ${{ secrets.GITHUB_TOKEN }} + title: 'Coverage Report' + update-comment: true + debug-mode: true diff --git a/pom.xml b/pom.xml index 8448e670cf..9daa76f748 100755 --- a/pom.xml +++ b/pom.xml @@ -449,4 +449,27 @@ + + + + coverage + + + + org.jacoco + jacoco-maven-plugin + 0.8.11 + + + + prepare-agent + report + + + + + + + + \ No newline at end of file