fix
Some checks failed
SonarQube / Build and analyze (push) Failing after 2m57s

This commit is contained in:
Leonid Pershin
2025-10-21 03:29:15 +03:00
parent b8fc79992a
commit dab86d1c81
5 changed files with 309 additions and 8 deletions

View File

@@ -26,10 +26,6 @@ jobs:
run: |
mkdir -p ~/.sonar/scanner
dotnet tool install dotnet-sonarscanner --tool-path ~/.sonar/scanner
- name: Install dotnet-coverage
run: |
mkdir -p ~/.sonar/coverage
dotnet tool install dotnet-coverage --tool-path ~/.sonar/coverage
- name: Restore dependencies
run: dotnet restore --verbosity normal
- name: Build and analyze
@@ -40,11 +36,11 @@ jobs:
echo "Current directory: $(pwd)"
echo "Listing files:"
ls -la
echo "Installing SonarQube scanner..."
~/.sonar/scanner/dotnet-sonarscanner begin /k:"mrleo1nid_chatbot" /o:"mrleo1nid" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
echo "Starting SonarQube scanner..."
~/.sonar/scanner/dotnet-sonarscanner begin /k:"mrleo1nid_chatbot" /o:"mrleo1nid" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.cs.opencover.reportsPaths="**/coverage.opencover.xml" /d:sonar.coverage.exclusions="**/Migrations/**/*.cs,**/*ModelSnapshot.cs"
echo "Building project..."
dotnet build --verbosity normal --no-incremental
echo "Collecting coverage..."
~/.sonar/coverage/dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml"
echo "Running tests with coverage..."
dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput=./coverage/ /p:Exclude="[*]*.Migrations.*" /p:ExcludeByFile="**/Migrations/*.cs"
echo "Ending SonarQube analysis..."
~/.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"