Skip to content

Commit

Permalink
Merge pull request #3 from LorenzoBettini/coverage
Browse files Browse the repository at this point in the history
Coverage
  • Loading branch information
LorenzoBettini committed Jan 21, 2021
2 parents 02821be + 950a354 commit 5efe8ba
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@ jobs:
build:
runs-on: ubuntu-latest
strategy:
# test against several Java versions:
matrix:
# test against several Java versions:
java: [ 8, 11 ]
include:
- java: 8
additional-maven-args: "-Pjacoco"
- java: 11

name: Build with Java ${{ matrix.java }} on Linux
steps:
Expand All @@ -28,7 +31,9 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-
- name: Build with Maven
run: mvn -f com.examples.myproject/pom.xml clean verify
run: >
mvn -f com.examples.myproject/pom.xml
clean verify ${{ matrix.additional-maven-args }}
- name: Generate JUnit Report
run: >
mvn -f com.examples.myproject/pom.xml
Expand Down
30 changes: 30 additions & 0 deletions com.examples.myproject/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,37 @@
<artifactId>maven-site-plugin</artifactId>
<version>3.9.1</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.6</version>
<executions>
<execution>
<goals>
<!-- binds by default to the phase "initialize" -->
<goal>prepare-agent</goal>
<!-- binds by default to the phase "verify" -->
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<id>jacoco</id>
<build>
<plugins>
<plugin>
<!-- configured in pluginManagement -->
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit 5efe8ba

Please sign in to comment.