Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate Codecov to the build procedure #703

Merged
merged 6 commits into from
Nov 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,21 @@ jobs:
- name: Test Jackson 2.12
run: ./mvnw --batch-mode --no-transfer-progress --show-version --settings .github/maven/settings.xml -Djackson.version=2.12.5 surefire:test

- name: Upload Test Reports
- name: Upload Test Reports to Github
uses: actions/upload-artifact@v2
if: ${{ always() }}
with:
name: test-reports-${{ matrix.java }}
path: '**/target/surefire-reports/**'
if-no-files-found: ignore

- name: Upload Test Coverage to Codecov
uses: codecov/codecov-action@v2
if: matrix.java == '8'
with:
files: target/site/jacoco/jacoco.xml


release:
name: release
runs-on: ubuntu-20.04
Expand Down
92 changes: 69 additions & 23 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,29 @@
</execution>
</executions>
</plugin>

<!-- Install JaCoCo agent and produce reports at the end of the build.
-->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>jacoco-prepare-agent</id>
<phase>process-test-classes</phase> <!-- must be ready for the `test` phase, default is "initialize" -->
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>jacoco-report</id>
<phase>verify</phase> <!-- this is the default -->
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -544,6 +567,29 @@
<artifactId>maven-resources-plugin</artifactId>
<version>${maven-resources-plugin.version}</version>
</plugin>

<!-- Java Code Coverage (JaCoCo)
-->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<configuration>
<!-- Only instrument "net.logstash.**" by default
-->
<includes>
<include>net/logstash/**</include>
</includes>

<!-- Produce XML report for Codecov, and HTML for local builds if user wants to
have a look at it...
-->
<formats>
<format>XML</format>
<format>HTML</format>
</formats>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
Expand Down Expand Up @@ -605,30 +651,30 @@
</properties>
</profile>

<!--
Profile used by the Eclipse Maven plugin (m2eclipse).
Activation:
Profile is activated if the property "m2e.version" is found.
The Eclipse plugin automatically exports this property which in turn causes the profile
to be automatically activated under Eclipse.
-->
<profile>
<id>m2e</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>
<!--
Profile used by the Eclipse Maven plugin (m2eclipse).
Activation:
Profile is activated if the property "m2e.version" is found.
The Eclipse plugin automatically exports this property which in turn causes the profile
to be automatically activated under Eclipse.
-->
<profile>
<id>m2e</id>
<activation>
<property>
<name>m2e.version</name>
</property>
</activation>

<build>
<!--
Tell eclipse to use another directory for its generated classes than the one
used by the command line Maven.
-->
<directory>target-eclipse</directory>
</build>
</profile>
<build>
<!--
Tell eclipse to use another directory for its generated classes than the one
used by the command line Maven.
-->
<directory>target-eclipse</directory>
</build>
</profile>

<!--
"Fast" profile that can be used during local development to disable most of the "heavy"
Expand Down