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 @@ net8.0 enable enable - 2.1.5 + 2.1.6 true TakasakiStudio.Lina.AspNet TakasakiStudio diff --git a/TakasakiStudio.Lina.AutoDependencyInjection/TakasakiStudio.Lina.AutoDependencyInjection.csproj b/TakasakiStudio.Lina.AutoDependencyInjection/TakasakiStudio.Lina.AutoDependencyInjection.csproj index 02668f7..02f5a77 100644 --- a/TakasakiStudio.Lina.AutoDependencyInjection/TakasakiStudio.Lina.AutoDependencyInjection.csproj +++ b/TakasakiStudio.Lina.AutoDependencyInjection/TakasakiStudio.Lina.AutoDependencyInjection.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 2.1.5 + 2.1.6 true TakasakiStudio.Lina.AutoDependencyInjection TakasakiStudio diff --git a/TakasakiStudio.Lina.Common/TakasakiStudio.Lina.Common.csproj b/TakasakiStudio.Lina.Common/TakasakiStudio.Lina.Common.csproj index 7eee659..5cc849d 100644 --- a/TakasakiStudio.Lina.Common/TakasakiStudio.Lina.Common.csproj +++ b/TakasakiStudio.Lina.Common/TakasakiStudio.Lina.Common.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 2.1.5 + 2.1.6 true TakasakiStudio.Lina.Common TakasakiStudio.Lina.Common diff --git a/TakasakiStudio.Lina.Database/TakasakiStudio.Lina.Database.csproj b/TakasakiStudio.Lina.Database/TakasakiStudio.Lina.Database.csproj index 7ea0f33..d891679 100644 --- a/TakasakiStudio.Lina.Database/TakasakiStudio.Lina.Database.csproj +++ b/TakasakiStudio.Lina.Database/TakasakiStudio.Lina.Database.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 2.1.5 + 2.1.6 true TakasakiStudio.Lina.Database TakasakiStudio.Lina.Database @@ -20,7 +20,7 @@ - + diff --git a/TakasakiStudio.Lina.Test/TakasakiStudio.Lina.Test.csproj b/TakasakiStudio.Lina.Test/TakasakiStudio.Lina.Test.csproj index 84402cb..527ad8d 100644 --- a/TakasakiStudio.Lina.Test/TakasakiStudio.Lina.Test.csproj +++ b/TakasakiStudio.Lina.Test/TakasakiStudio.Lina.Test.csproj @@ -10,9 +10,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/TakasakiStudio.Lina.Utils/TakasakiStudio.Lina.Utils.csproj b/TakasakiStudio.Lina.Utils/TakasakiStudio.Lina.Utils.csproj index 09555b1..9f8e4ec 100644 --- a/TakasakiStudio.Lina.Utils/TakasakiStudio.Lina.Utils.csproj +++ b/TakasakiStudio.Lina.Utils/TakasakiStudio.Lina.Utils.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 2.1.5 + 2.1.6 true TakasakiStudio.Lina.Utils TakasakiStudio.Lina.Utils diff --git a/TakasakiStudio.Lina/TakasakiStudio.Lina.csproj b/TakasakiStudio.Lina/TakasakiStudio.Lina.csproj index 26cb261..d3dd9ef 100644 --- a/TakasakiStudio.Lina/TakasakiStudio.Lina.csproj +++ b/TakasakiStudio.Lina/TakasakiStudio.Lina.csproj @@ -4,7 +4,7 @@ net8.0 enable enable - 2.1.5 + 2.1.6 true TakasakiStudio.Lina TakasakiStudio.Lina