From 4a71f117d4473297e3d3fd38b6fc71093792646f Mon Sep 17 00:00:00 2001 From: Jeff Mesnil Date: Wed, 2 Aug 2023 16:38:27 +0200 Subject: [PATCH] Add code coverage Run the GitHub action with the `coverage` profile to generate a code coverage report in target/site/jacoco and associate it to the GH Action runs Signed-off-by: Jeff Mesnil --- .github/workflows/build.yml | 22 ++++++++------- pom.xml | 54 +++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b9037a..180cc50 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: SmallRye Module Info Build +name: Build StAXMapper on: push: @@ -11,15 +11,19 @@ jobs: build: runs-on: ubuntu-latest name: build with JDK 11 - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 name: checkout - - - uses: AdoptOpenJDK/install-jdk@v1 - name: set up JDK 11 + - name: Set up JDK 11 + uses: actions/setup-java@v3 with: - version: 11 - + java-version: '11' + distribution: 'temurin' + cache: maven - name: Build - run: mvn -B install --file pom.xml + run: mvn -B install --file pom.xml -P coverage + - name: Upload code coverage report + uses: 'actions/upload-artifact@v2' + with: + name: jacoco + path: target/site/jacoco \ No newline at end of file diff --git a/pom.xml b/pom.xml index dcd7269..96d4498 100644 --- a/pom.xml +++ b/pom.xml @@ -93,4 +93,58 @@ + + + + coverage + + + + org.jacoco + jacoco-maven-plugin + 0.8.10 + + + prepare-agent + + prepare-agent + + generate-test-resources + + + report + prepare-package + + report + + + + merge + + merge + + + + + . + + **/*.exec + + + + + + + aggregate-report + verify + + report-aggregate + + + + + + + +