WIP: Report test coverage on pull request #58
31
.gitea/workflows/coverage-report.yaml
Normal file
31
.gitea/workflows/coverage-report.yaml
Normal file
@ -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
|
23
pom.xml
23
pom.xml
@ -449,4 +449,27 @@
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>coverage</id>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.11</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
Loading…
x
Reference in New Issue
Block a user