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 PATH: ${{ env.PATH }}:/root/.dotnet/tools
steps: steps:
- name: Checkout code - name: Checkout code
run: | run: /bin/bash -c |
echo "Checking out code..." echo "Checking out code..."
echo "Current directory: $(pwd)" echo "Current directory: $(pwd)"
echo "Files in current directory:" echo "Files in current directory:"
ls -la ls -la
- name: Setup .NET - name: Setup .NET
run: | run: /bin/bash -c |
echo "Setting up .NET..." echo "Setting up .NET..."
dotnet --version dotnet --version
echo "Dotnet is available" echo "Dotnet is available"
- name: Restore dependencies - name: Restore dependencies
run: dotnet restore run: /bin/bash -c "dotnet restore"
- name: Install dotnet-coverage - name: Install dotnet-coverage
run: | run: /bin/bash -c |
dotnet tool install --global dotnet-coverage dotnet tool install --global dotnet-coverage
echo "Adding .dotnet/tools to PATH..." echo "Adding .dotnet/tools to PATH..."
echo 'export PATH="$PATH:/root/.dotnet/tools"' >> ~/.bashrc 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" ls -la /root/.dotnet/tools/ | grep dotnet-coverage || echo "No dotnet-coverage in tools directory"
- name: Install SonarCloud Scanner - 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 - 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: env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- name: Build - name: Build
run: dotnet build --no-incremental run: /bin/bash -c "dotnet build --no-incremental"
- name: Run tests and collect coverage - name: Run tests and collect coverage
run: | run: /bin/bash -c |
echo "Running tests and collecting coverage..." echo "Running tests and collecting coverage..."
echo "PATH: $PATH" echo "PATH: $PATH"
echo "Trying dotnet-coverage from PATH..." echo "Trying dotnet-coverage from PATH..."
@@ -76,12 +76,12 @@ jobs:
fi fi
- name: List files for debug - name: List files for debug
run: ls -la run: /bin/bash -c "ls -la"
- name: Print coverage.xml for debug - name: Print coverage.xml for debug
run: cat coverage.xml run: /bin/bash -c "cat coverage.xml"
- name: End SonarCloud analysis - 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: env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}