This commit is contained in:
@@ -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 }}"
|
||||
Reference in New Issue
Block a user