Config v6 #385
Workflow file for this run
This file contains 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: SonarCloud Analysis | |
on: | |
push: | |
branches: [ master ] | |
paths-ignore: | |
- '**.md' | |
- 'appveyor*' | |
pull_request: | |
types: [opened, synchronize, reopened] | |
env: | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
jobs: | |
analysis: | |
name: Run analysis & code coverage | |
runs-on: windows-2022 | |
steps: | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 1.11 | |
- uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Cache SonarCloud packages | |
uses: actions/cache@v1 | |
with: | |
path: ~\sonar\cache | |
key: ${{ runner.os }}-sonar | |
restore-keys: ${{ runner.os }}-sonar | |
- name: Cache SonarCloud scanner | |
id: cache-sonar-scanner | |
uses: actions/cache@v1 | |
with: | |
path: .\.sonar\scanner | |
key: ${{ runner.os }}-sonar-scanner | |
restore-keys: ${{ runner.os }}-sonar-scanner | |
- name: Install SonarCloud scanner | |
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true' | |
shell: powershell | |
run: | | |
New-Item -Path .\.sonar\scanner -ItemType Directory | |
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner | |
- name: Build and analyze | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
shell: powershell | |
run: | | |
.\.sonar\scanner\dotnet-sonarscanner begin /k:"net-sdk" /d:sonar.host.url="https://sonarcloud.io" /o:"configcat" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx" /v:"${{ github.run_number }}" /d:sonar.exclusions="ConfigCatClient/Versioning/*" /d:sonar.coverage.exclusions="ConfigCatClient/Versioning/*" | |
dotnet test src\ConfigCat.Client.Tests\ConfigCat.Client.Tests.csproj -c Release --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover | |
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}" |