42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
name: SonarQube Scan
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
sonarqube:
|
|
name: SonarQube Trigger
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout Code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # Disables shallow clone for more accurate blame/analysis data
|
|
|
|
- name: Setup .NET
|
|
uses: actions/setup-dotnet@v3
|
|
with:
|
|
dotnet-version: '10.0.x'
|
|
|
|
- name: Restore Dependencies
|
|
run: dotnet restore Dotnet.Samples.AspNetCore.WebApi.sln
|
|
|
|
- name: Build Solution
|
|
run: dotnet build Dotnet.Samples.AspNetCore.WebApi.sln --no-restore
|
|
|
|
- name : Run Tests
|
|
run: dotnet test Dotnet.Samples.AspNetCore.WebApi.sln --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory ./TestResults
|
|
|
|
- name: Run SonarQube Scanner
|
|
uses: sonarsource/sonarqube-scan-action@v6
|
|
with:
|
|
# Verhindert den Abbruch auf dem Pi, falls GPG/dirmngr fehlen
|
|
skipSignatureVerification: true
|
|
env:
|
|
SONAR_HOST_URL: http://docker01.fritz.box:9001
|
|
SONAR_TOKEN: sqa_0d70a516435d3905842ba7003fbd64a1a7b4b0bc
|