diff --git a/.github/workflows/build-and-deploy-preprod.yml b/.github/workflows/build-and-deploy-preprod.yml index 6159c9b6..e86825c1 100644 --- a/.github/workflows/build-and-deploy-preprod.yml +++ b/.github/workflows/build-and-deploy-preprod.yml @@ -10,6 +10,7 @@ jobs: permissions: contents: "read" id-token: "write" + pull-requests: write steps: - uses: actions/checkout@v4 with: @@ -24,6 +25,15 @@ jobs: GITHUB_USERNAME: x-access-token GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: mvn -B --no-transfer-progress package verify --settings .m2/maven-settings.xml --file pom.xml + - 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 93ed863b..96f92c28 100644 --- a/pom.xml +++ b/pom.xml @@ -539,6 +539,31 @@ + + org.jacoco + jacoco-maven-plugin + 0.8.12 + + + **/*config.* + + + + + prepare-agent + + prepare-agent + + + + report + test + + report + + + +