Skip to content

Commit

Permalink
Switch SonarScanner to automated mode (#139)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tspence authored Sep 11, 2023
1 parent 70b0e0d commit fbc495b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 25 deletions.
28 changes: 5 additions & 23 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
2 changes: 1 addition & 1 deletion src/SearchlightPerformance/SearchlightPerformance.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
<Nullable>disable</Nullable>
<RootNamespace>perftest</RootNamespace>
<OutputType>Exe</OutputType>
Expand Down
2 changes: 1 addition & 1 deletion tests/Searchlight.Tests/Searchlight.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<IsPackable>false</IsPackable>

<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net7.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit fbc495b

Please sign in to comment.