diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e725dfa74904..5b617a86dca2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,9 @@ name: Build on: [push, pull_request] + +env: + COVERAGE_REPORT_PATH: "target/site/jacoco/jacoco.xml" + jobs: build: runs-on: ubuntu-latest @@ -12,3 +16,8 @@ jobs: distribution: 'adopt' - name: Build with Maven run: mvn --batch-mode --update-snapshots verify + - name: Upload coverage to codecov + uses: codecov/codecov-action@v3 + with: + files: "${{ env.REPORT_NAME }}" + fail_ci_if_error: true diff --git a/pom.xml b/pom.xml index 86922e1f0a98..23f90f682158 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,10 @@ maven-surefire-plugin - 2.22.2 + 3.2.5 + + + org.apache.maven.plugins @@ -74,6 +77,25 @@ 17 + + org.jacoco + jacoco-maven-plugin + 0.8.12 + + + + prepare-agent + + + + generate-code-coverage-report + test + + report + + + + - \ No newline at end of file +