Update master 31.01 11AM #713
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 | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
pull_request: | |
types: [opened, synchronize, reopened] | |
jobs: | |
sonarcloud_branch: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
distribution: 'temurin' | |
java-version: '17' | |
overwrite-settings: false | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 6.0.x | |
- name: Install dotnet-coverage | |
run: dotnet tool install --global dotnet-coverage | |
- name: Install dotnet-sonarscanner | |
run: dotnet tool install --global dotnet-sonarscanner | |
- name: Restore Dependencies | |
run: dotnet restore ./Streetcode/Streetcode.sln | |
- name: Build | |
run: dotnet build ./Streetcode/Streetcode.sln --configuration Release --no-restore | |
- name: Test and Code Coverage | |
run: dotnet-coverage collect "dotnet test ./Streetcode/Streetcode.XUnitTest/Streetcode.XUnitTest.csproj --configuration Release --results-directory ./coverage --logger trx" -f xml -o coverage.xml | |
- name: SonarScanner Analysis | |
id: sonar | |
run: | | |
dotnet sonarscanner begin /k:"ita-social-projects_StreetCode" /o:"ita-social-projects" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths="**/coverage.xml" | |
dotnet build ./Streetcode/Streetcode.sln --configuration Release | |
dotnet test ./Streetcode/Streetcode.XUnitTest/Streetcode.XUnitTest.csproj --configuration Release --no-build --verbosity normal | |
dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" |