Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch SonarScanner to automated mode #139

Merged
merged 2 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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