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

Gh-2972: Codecov can generate inconsistent coverage reports #2973

Closed
Show file tree
Hide file tree
Changes from 7 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
26 changes: 24 additions & 2 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ jobs:
- os: windows-latest
modules:
name: Rest

env:
MAVEN_OPTS: -Dmaven.wagon.http.retryHandler.count=3 -Dmaven.wagon.httpconnectionManager.ttlSeconds=25
steps:
Expand Down Expand Up @@ -122,6 +121,29 @@ jobs:
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
run: mvn -B -ntp spotless:check -pl ${{matrix.modules.values}}

- name: Upload Coverage
- name: Add JaCoCo reports to artifact
uses: actions/upload-artifact@v3
if: matrix.os == 'ubuntu-latest'
with:
name: combined-jacoco-coverage
path: "*/**/jacoco.xml"
retention-days: 5

upload-test-coverage:
name: Upload coverage to Codecov
runs-on: ubuntu-latest
needs:
- build-and-run-tests
steps:
- uses: actions/checkout@v3 # Codecov need to see the src code to pair with coverage

- name: Fetch JaCoCo reports artifact
uses: actions/download-artifact@v3
with:
name: combined-jacoco-coverage

- name: Upload to Codecov
uses: codecov/codecov-action@v3
with:
name: gaffer-coverage
fail_ci_if_error: true # Ensures upload doesn't fail silently
16 changes: 2 additions & 14 deletions example/pom.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2016-2020 Crown Copyright
~ Copyright 2016-2023 Crown Copyright
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,17 +32,4 @@
<module>basic</module>
<module>federated-demo</module>
</modules>

<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</build>
</project>