Skip to content

Commit

Permalink
Jacoco-report (#1169)
Browse files Browse the repository at this point in the history
* Jacoco-report
  • Loading branch information
stigebil authored Sep 19, 2024
1 parent f119468 commit 0b0f2e7
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/build-and-deploy-preprod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]'
Expand Down
26 changes: 26 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,32 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.12</version>
<configuration>
<excludes>
<exclude>**/*config.*</exclude>
<exclude>no.nav.joarkjournalfoeringhendelser.*</exclude>
</excludes>
</configuration>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down

0 comments on commit 0b0f2e7

Please sign in to comment.