Fixing pipeline

This commit is contained in:
2024-05-05 02:48:10 +02:00
parent 23ca30f084
commit f53e289f51

View File

@@ -42,22 +42,11 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
# dotnet test ./MainProject.Tests/MainProject.Tests.csproj --no-restore --configuration Release --collect:"XPlat Code Coverage;Format=opencover" --logger "trx;LogFileName=test-results.trx" --results-directory "./TestResults"
run:
| # /d:sonar.coverage.opencover.reportsPaths="./TestResults/**/coverage.opencover.xml"
.\.sonar\scanner\dotnet-sonarscanner begin /k:"csimonapastore_BasicDotnetTemplate" /o:"csimonapastore-github" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
# coverage_file=$(find ./TestResults -name "coverage.opencover.xml" -type f)
# if [-f "$coverage_file"]; then
# .sonar\scanner\dotnet-sonarscanner begin /k:"csimonapastore_BasicDotnetTemplate" /o:"csimonapastore-github" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverage.opencover.reportsPaths="$coverage_file"
# dotnet restore
# dotnet build --no-incremental --no-restore --configuration Release
# .sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
# else
# echo "File di copertura non trovato."
# exit 1
# fi
.\.sonar\scanner\dotnet-sonarscanner begin /k:"csimonapastore_BasicDotnetTemplate" /o:"csimonapastore-github" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.coverage.opencover.reportsPaths="./TestResults/**/coverage.opencover.xml"
dotnet restore
dotnet build --no-incremental --no-restore --configuration Release
dotnet test ./MainProject.Tests/MainProject.Tests.csproj --no-restore --configuration Release --collect:"XPlat Code Coverage;Format=opencover" --logger "trx;LogFileName=test-results.trx" --results-directory "./TestResults"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
dotnet restore
dotnet build --no-incremental --no-restore --configuration Release
dotnet test ./MainProject.Tests/MainProject.Tests.csproj --no-restore --configuration Release --collect:"XPlat Code Coverage;Format=opencover" --logger "trx;LogFileName=test-results.trx" --results-directory "./TestResults"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"