fix
This commit is contained in:
@@ -40,27 +40,11 @@ jobs:
|
|||||||
echo "Current directory: $(pwd)"
|
echo "Current directory: $(pwd)"
|
||||||
echo "Listing files:"
|
echo "Listing files:"
|
||||||
ls -la
|
ls -la
|
||||||
|
|
||||||
# Check if SONAR_TOKEN is set
|
|
||||||
if [ -z "$SONAR_TOKEN" ]; then
|
|
||||||
echo "❌ SONAR_TOKEN is not set. Please configure the secret in repository settings."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Installing SonarQube scanner..."
|
echo "Installing SonarQube scanner..."
|
||||||
~/.sonar/scanner/dotnet-sonarscanner begin \
|
~/.sonar/scanner/dotnet-sonarscanner begin /k:"mrleo1nid_chatbot" /o:"mrleo1nid" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml
|
||||||
/k:"mrleo1nid_chatbot" \
|
|
||||||
/o:"mrleo1nid" \
|
|
||||||
/d:sonar.token="${{ secrets.SONAR_TOKEN }}" \
|
|
||||||
/d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml \
|
|
||||||
/d:sonar.scanner.skipJreProvisioning=true \
|
|
||||||
/d:sonar.host.url=https://sonarcloud.io
|
|
||||||
|
|
||||||
echo "Building project..."
|
echo "Building project..."
|
||||||
dotnet build --verbosity normal --no-incremental
|
dotnet build --verbosity normal --no-incremental
|
||||||
|
echo "Collecting coverage..."
|
||||||
echo "Running tests and collecting coverage..."
|
~/.sonar/coverage/dotnet-coverage collect "dotnet test" -f xml -o "coverage.xml"
|
||||||
dotnet test --verbosity normal --logger "trx;LogFileName=test-results.trx" --results-directory ./TestResults --collect:"XPlat Code Coverage" --settings coverlet.runsettings
|
|
||||||
|
|
||||||
echo "Ending SonarQube analysis..."
|
echo "Ending SonarQube analysis..."
|
||||||
~/.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
|
~/.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
|
||||||
Reference in New Issue
Block a user