chore(deps): Bump the test-tooling group with 8 updates #717
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: Sonar | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: sonar-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| analyze: | |
| name: SonarCloud | |
| runs-on: ubuntu-latest | |
| # The whole job is skipped (neutral, never red) until SonarCloud is fully set up. | |
| # To activate: import the project on sonarcloud.io, add the SONAR_TOKEN secret, | |
| # then set the repository variable SONAR_ENABLED to "true" | |
| # (gh variable set SONAR_ENABLED --body true). | |
| if: ${{ vars.SONAR_ENABLED == 'true' && github.repository == 'thiagoluga/NeoReports' }} | |
| env: | |
| DOTNET_NOLOGO: true | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| # Full history gives Sonar accurate new-code / blame information. | |
| fetch-depth: 0 | |
| - name: Setup .NET (8 + 9) | |
| uses: actions/setup-dotnet@v6 | |
| with: | |
| dotnet-version: | | |
| 8.0.x | |
| 9.0.x | |
| - name: Setup Java (required by the Sonar scanner) | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| java-version: "17" | |
| - name: Install Sonar + coverage tools | |
| run: | | |
| dotnet tool install --global dotnet-sonarscanner | |
| dotnet tool install --global dotnet-coverage | |
| - name: Build, test (with coverage) and analyze | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| # Hard-fail the Testcontainers suites if Docker can't start here too (see tests/Shared/DockerGate.cs). | |
| NEOREPORTS_REQUIRE_DOCKER: "1" | |
| run: | | |
| dotnet sonarscanner begin \ | |
| /k:"lugarini_NeoReports" \ | |
| /o:"lugarini" \ | |
| /d:sonar.host.url="https://sonarcloud.io" \ | |
| /d:sonar.token="${SONAR_TOKEN}" \ | |
| /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml \ | |
| /d:sonar.coverage.exclusions="benchmarks/**,samples/**,src/UI/**" \ | |
| /d:sonar.cpd.exclusions="benchmarks/**,samples/**,src/UI/**" \ | |
| /d:sonar.qualitygate.wait=true | |
| dotnet build NeoReports.sln --configuration Release | |
| dotnet-coverage collect "dotnet test NeoReports.sln --configuration Release --no-build" -f xml -o coverage.xml | |
| dotnet sonarscanner end /d:sonar.token="${SONAR_TOKEN}" |