This commit is contained in:
Leonid Pershin
2025-10-17 08:00:03 +03:00
parent 83e7b9b04e
commit 6a2d5e6220

View File

@@ -22,23 +22,23 @@ jobs:
PATH: ${{ env.PATH }}:/root/.dotnet/tools
steps:
- name: Checkout code
run: |
run: /bin/bash -c |
echo "Checking out code..."
echo "Current directory: $(pwd)"
echo "Files in current directory:"
ls -la
- name: Setup .NET
run: |
run: /bin/bash -c |
echo "Setting up .NET..."
dotnet --version
echo "Dotnet is available"
- name: Restore dependencies
run: dotnet restore
run: /bin/bash -c "dotnet restore"
- name: Install dotnet-coverage
run: |
run: /bin/bash -c |
dotnet tool install --global dotnet-coverage
echo "Adding .dotnet/tools to PATH..."
echo 'export PATH="$PATH:/root/.dotnet/tools"' >> ~/.bashrc
@@ -48,17 +48,17 @@ jobs:
ls -la /root/.dotnet/tools/ | grep dotnet-coverage || echo "No dotnet-coverage in tools directory"
- name: Install SonarCloud Scanner
run: dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner
run: /bin/bash -c "dotnet tool update dotnet-sonarscanner --tool-path ./.sonar/scanner"
- name: Begin SonarCloud analysis
run: ./.sonar/scanner/dotnet-sonarscanner begin /k:"${{ env.SONAR_PROJECT_KEY }}" /o:"${{ env.SONAR_ORG }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="${{ env.SONAR_HOST_URL }}" /d:sonar.cs.vscoveragexml.reportsPaths="coverage.xml"
run: /bin/bash -c "./.sonar/scanner/dotnet-sonarscanner begin /k:\"${{ env.SONAR_PROJECT_KEY }}\" /o:\"${{ env.SONAR_ORG }}\" /d:sonar.token=\"${{ secrets.SONAR_TOKEN }}\" /d:sonar.host.url=\"${{ env.SONAR_HOST_URL }}\" /d:sonar.cs.vscoveragexml.reportsPaths=\"coverage.xml\""
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Build
run: dotnet build --no-incremental
run: /bin/bash -c "dotnet build --no-incremental"
- name: Run tests and collect coverage
run: |
run: /bin/bash -c |
echo "Running tests and collecting coverage..."
echo "PATH: $PATH"
echo "Trying dotnet-coverage from PATH..."
@@ -76,12 +76,12 @@ jobs:
fi
- name: List files for debug
run: ls -la
run: /bin/bash -c "ls -la"
- name: Print coverage.xml for debug
run: cat coverage.xml
run: /bin/bash -c "cat coverage.xml"
- name: End SonarCloud analysis
run: ./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
run: /bin/bash -c "./.sonar/scanner/dotnet-sonarscanner end /d:sonar.token=\"${{ secrets.SONAR_TOKEN }}\""
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}