Skip to content

Ny tabell-struktur

Ny tabell-struktur #94

Workflow file for this run

name: Testdekning JaCoCo og Sonar
on:
workflow_dispatch:
pull_request:
jobs:
integrasjonstester:
name: Integrasjonstester
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Kjør integrasjonstester
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mvn install --no-transfer-progress --settings .m2/maven-settings.xml --file pom.xml -Dsurefire.rerunFailingTestsCount=2 -Pjacoco
- name: Last opp JaCoCo rapport
uses: actions/upload-artifact@v4
with:
name: jacoco
path: target/site/jacoco/jacoco.xml
retention-days: 1
overwrite: true
sonar:
name: Sonar
runs-on: ubuntu-latest
needs: [integrasjonstester]
if: github.actor != 'dependabot[bot]'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 21
distribution: 'temurin'
cache: 'maven'
- name: Last ned JaCoCo rapport
uses: actions/download-artifact@v4
with:
name: jacoco
path: target/site/jacoco
- name: Cache Sonar packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Kjør Sonar
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_PROJECTKEY: ${{ secrets.SONAR_PROJECTKEY }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn sonar:sonar -Dsonar.coverage.jacoco.xmlReportPaths="jacoco/jacoco.xml"