diff --git a/.github/workflows/dotnet8.yml b/.github/workflows/dotnet8.yml
index 6407f02..5d61975 100644
--- a/.github/workflows/dotnet8.yml
+++ b/.github/workflows/dotnet8.yml
@@ -9,6 +9,7 @@ on:
jobs:
build:
+ name: Build
strategy:
matrix:
platform: [ ubuntu-latest, macos-latest, windows-latest ]
@@ -29,7 +30,7 @@ jobs:
run: dotnet build --no-restore /WarnAsError
test:
- needs: [ build ]
+ name: Test
strategy:
matrix:
platform: [ ubuntu-latest, macos-latest, windows-latest ]
@@ -48,9 +49,50 @@ jobs:
run: dotnet restore
- name: Test
run: dotnet test --verbosity normal
+
+ sonar:
+ name: Sonar Qube
+ needs: [ build, test ]
+ runs-on: windows-latest
+
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
+ - name: Set up JDK 17
+ uses: actions/setup-java@v4
+ with:
+ java-version: 17
+ distribution: 'temurin'
+ - name: Cache SonarQube packages
+ uses: actions/cache@v4
+ with:
+ path: ~\.sonar\cache
+ key: ${{ runner.os }}-sonar
+ restore-keys: ${{ runner.os }}-sonar
+ - name: Cache SonarQube scanner
+ id: cache-sonar-scanner
+ uses: actions/cache@v4
+ with:
+ path: .\.sonar\scanner
+ key: ${{ runner.os }}-sonar-scanner
+ restore-keys: ${{ runner.os }}-sonar-scanner
+ - name: Install SonarQube scanner
+ if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
+ shell: powershell
+ run: |
+ New-Item -Path .\.sonar\scanner -ItemType Directory
+ dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
+ - name: Build and analyze
+ shell: powershell
+ run: |
+ .\.sonar\scanner\dotnet-sonarscanner begin /k:"Takasaki-Studio_Lina_15f9a6a7-ef3c-4937-88f6-40e4f890d8f1" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}"
+ dotnet build
+ .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
publish_github:
- needs: [ test ]
+ name: Publish Github
+ needs: [ sonar ]
environment: 'Production'
runs-on: ubuntu-latest
if: github.ref_name == 'dotnet8' && github.event_name == 'push'
@@ -81,7 +123,8 @@ jobs:
run: dotnet nuget push "./TakasakiStudio.Lina/bin/Release/*.nupkg" --api-key ${{ secrets.SECRET }} --source "github"
publish_nuget:
- needs: [ test ]
+ name: Publish Nuget
+ needs: [ sonar ]
environment: 'Production Nuget'
runs-on: ubuntu-latest
if: github.ref_name == 'dotnet8' && github.event_name == 'push'
diff --git a/README.md b/README.md
index 6472394..7dab4a1 100644
--- a/README.md
+++ b/README.md
@@ -2,6 +2,8 @@
A framework to simplify application creation by improving dependency injection, validation, config and database handling
+[![Quality gate](https://qube.takasaki.studio/api/project_badges/quality_gate?project=Takasaki-Studio_Lina_15f9a6a7-ef3c-4937-88f6-40e4f890d8f1&token=sqb_e3d13032d4593a8be8fecd4a976ada88ba8696ac)](https://qube.takasaki.studio/dashboard?id=Takasaki-Studio_Lina_15f9a6a7-ef3c-4937-88f6-40e4f890d8f1)
+
## Features
- Config
diff --git a/TakasakiStudio.Lina.AspNet/TakasakiStudio.Lina.AspNet.csproj b/TakasakiStudio.Lina.AspNet/TakasakiStudio.Lina.AspNet.csproj
index 6a14b4d..0c065ce 100644
--- a/TakasakiStudio.Lina.AspNet/TakasakiStudio.Lina.AspNet.csproj
+++ b/TakasakiStudio.Lina.AspNet/TakasakiStudio.Lina.AspNet.csproj
@@ -4,7 +4,7 @@