From 0b0f2e7259ba6cd21c702d2d6f44667907169af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Str=C3=B8m?= Date: Thu, 19 Sep 2024 11:42:32 +0200 Subject: [PATCH] Jacoco-report (#1169) * Jacoco-report --- .../workflows/build-and-deploy-preprod.yml | 22 ++++++++++++++-- pom.xml | 26 +++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-deploy-preprod.yml b/.github/workflows/build-and-deploy-preprod.yml index efe1ebdcb..8906e3136 100644 --- a/.github/workflows/build-and-deploy-preprod.yml +++ b/.github/workflows/build-and-deploy-preprod.yml @@ -31,9 +31,10 @@ jobs: name: Build and push runs-on: ubuntu-latest permissions: - contents: "read" - id-token: "write" + contents: read + id-token: write packages: write + pull-requests: write steps: - run: echo "event navn er:" ${{ github.event_name }} ${{ github.event.action }} - uses: actions/checkout@v4 @@ -51,6 +52,23 @@ jobs: GITHUB_TOKEN: ${{ secrets.READER_TOKEN }} run: mvn -B --no-transfer-progress package --settings .m2/maven-settings.xml --file pom.xml + - name: Upload Report + uses: 'actions/upload-artifact@v4' + with: + name: jacoco-report + path: ${{ github.workspace }}/target/site/jacoco/ + retention-days: 2 + + - name: Add coverage to PR + id: jacoco + uses: madrapps/jacoco-report@v1.7.0 + with: + paths: ${{ github.workspace }}/target/site/jacoco/jacoco.xml + token: ${{ secrets.GITHUB_TOKEN }} + min-coverage-overall: 70 + min-coverage-changed-files: 70 + title: Code Coverage + - uses: nais/docker-build-push@v0 id: docker-push if: github.event.pull_request.user.login != 'dependabot[bot]' diff --git a/pom.xml b/pom.xml index a7bc96014..df6511d96 100644 --- a/pom.xml +++ b/pom.xml @@ -465,6 +465,32 @@ + + org.jacoco + jacoco-maven-plugin + 0.8.12 + + + **/*config.* + no.nav.joarkjournalfoeringhendelser.* + + + + + prepare-agent + + prepare-agent + + + + report + test + + report + + + +