run sonarqube as part of the CI

This commit is contained in:
Athou
2025-07-19 11:11:05 +02:00
parent 78d2e66c56
commit 3f2b93f1f8
2 changed files with 47 additions and 1 deletions

38
.github/workflows/sonar.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: SonarQube
on:
push:
branches:
- master
pull_request:
types: [ opened, synchronize, reopened ]
env:
JAVA_VERSION: 21
jobs:
build:
runs-on: ubuntu-latest
steps:
# Checkout
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
with:
fetch-depth: 0
# Setup
- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: "temurin"
cache: "maven"
- name: Install Playwright dependencies
run: sudo apt-get install -y libgbm1
# Run test coverage and SonarQube analysis
- name: Analyze with SonarQube
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn --batch-mode verify sonar:sonar -Dsonar.projectKey=Athou_commafeed