Bump the logging group with 2 updates (#9) #39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build & Test | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build: | |
| name: Build, Test & SonarCloud | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Java 21 (required by SonarScanner) | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: 21 | |
| - name: Set up .NET 10 | |
| uses: actions/setup-dotnet@v5 | |
| with: | |
| dotnet-version: 10.x | |
| - name: Cache NuGet packages | |
| uses: actions/cache@v5 | |
| with: | |
| path: ~/.nuget/packages | |
| key: nuget-${{ runner.os }}-${{ hashFiles('**/*.csproj') }} | |
| restore-keys: nuget-${{ runner.os }}- | |
| - name: Install SonarScanner for .NET | |
| run: dotnet tool install --global dotnet-sonarscanner | |
| - name: Restore dependencies | |
| run: dotnet restore | |
| - name: Begin SonarCloud analysis | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: | | |
| dotnet sonarscanner begin \ | |
| /k:"guibranco_grimoire-api" \ | |
| /o:"guibranco" \ | |
| /d:sonar.token="${{ secrets.SONAR_TOKEN }}" \ | |
| /d:sonar.host.url="https://sonarcloud.io" \ | |
| /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" \ | |
| /d:sonar.exclusions="**/Migrations/**,**/obj/**,**/bin/**" \ | |
| /d:sonar.coverage.exclusions="**/Migrations/**,**/Program.cs" | |
| - name: Build | |
| run: dotnet build --no-restore --configuration Release | |
| - name: Run tests with coverage | |
| run: | | |
| dotnet test --no-build --configuration Release \ | |
| --collect:"XPlat Code Coverage" \ | |
| --results-directory ./coverage \ | |
| -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover | |
| - name: End SonarCloud analysis | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| run: dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" |