Skip to content

🐛 (#195): fix jacoco coverage #191

🐛 (#195): fix jacoco coverage

🐛 (#195): fix jacoco coverage #191

name: Build project and run sonarqube analysis
on:
push:
paths:
- backend/**
- .github/workflows/backend-sonarqube-analysis.yml
jobs:
build-and-analyse:
if: ${{ !startsWith(github.ref, 'refs/heads/dependabot') }}
runs-on: ubuntu-latest
strategy:
matrix:
sonar:
- key: "hopps-app_hopps-document-ai"
folder: "app.hopps.az-document-ai"
label: "AZ Document AI"
- key: "hopps-app_hopps-vereine"
folder: "app.hopps.org"
label: "Org"
- key: "hopps-app_hopps-fin"
folder: "app.hopps.fin"
label: "Finanzen"
- key: "hopps-app_zugferd"
folder: "app.hopps.zugferd"
label: "ZUGFeRD"
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: "21"
distribution: "temurin"
cache: maven
- name: mvn install parent
run: mvn -B -N clean install --file backend/pom.xml
- name: mvn install commons
run: mvn -B install --file backend/app.hopps.commons/pom.xml
- name: mvn package
run: mvn -B verify --file backend/${{ matrix.sonar.folder }}/pom.xml
- name: Cache SonarQube packages
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: SonarQube Scan "${{ matrix.sonar.label }}"
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn -B sonar:sonar \
--file backend/${{ matrix.sonar.folder }}/pom.xml \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.organization=hopps-app \
-Dsonar.projectKey=${{ matrix.sonar.key }}