From fbc495b33072053d16aadae1d1ebe3d977304abf Mon Sep 17 00:00:00 2001 From: Ted Spence Date: Sun, 10 Sep 2023 18:20:02 -0700 Subject: [PATCH] Switch SonarScanner to automated mode (#139) This PR removes sonar scanner from the github action. From recent experience, I believe Sonar works better on its own. This means we lose the official code coverage numbers from Sonar but I'll live with that. --- .github/workflows/dotnet.yml | 28 ++++--------------- .../SearchlightPerformance.csproj | 2 +- .../Searchlight.Tests.csproj | 2 +- 3 files changed, 7 insertions(+), 25 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 3516058..acb4ed3 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -16,31 +16,13 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: 6.0.x - - name: Check Environment Variables (RUNNER_TEMP) - run: echo "Runner Temp is ${{env.RUNNER_TEMP}}" - - name: Check Environment Variables (TMP) - env: - TMP: ${{env.RUNNER_TEMP}} - run: echo "DotNet TMP is ${{env.TMP}}" + dotnet-version: 7.0.x - name: Restore run: dotnet restore - - name: SonarCloud Install - run: - dotnet tool update dotnet-sonarscanner --tool-path /tmp/sonar - - name: Coverage Install - run: - dotnet tool update dotnet-coverage --tool-path /tmp/coverage - - name: SonarCloud Start - run: - /tmp/sonar/dotnet-sonarscanner begin /k:"tspence_csharp-searchlight" /o:"tspence" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml - name: Build run: dotnet build - name: Test - env: - TMP: /tmp - run: - /tmp/coverage/dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml" - - name: SonarCloud End - run: - /tmp/sonar/dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" + run: dotnet test + + # We no longer use SonarCloud here; SonarCloud does automated scanning instead. + # This means we don't get code coverage but it is much faster and simpler. diff --git a/src/SearchlightPerformance/SearchlightPerformance.csproj b/src/SearchlightPerformance/SearchlightPerformance.csproj index c1c9476..68d2788 100644 --- a/src/SearchlightPerformance/SearchlightPerformance.csproj +++ b/src/SearchlightPerformance/SearchlightPerformance.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 disable perftest Exe diff --git a/tests/Searchlight.Tests/Searchlight.Tests.csproj b/tests/Searchlight.Tests/Searchlight.Tests.csproj index 331f8bb..a4dc112 100644 --- a/tests/Searchlight.Tests/Searchlight.Tests.csproj +++ b/tests/Searchlight.Tests/Searchlight.Tests.csproj @@ -4,7 +4,7 @@ false - net6.0 + net7.0