We’re trying to hook up sonarcloud to our github pull request process via GitHub Actions and notice the overall build time takes really long time. When I run the build commands on my local via Sonarqube, the whole process takes around 3mins. However, vis sonarcloud it takes 20-30 mins.
- ALM used
GitHub - CI system used
Azure DevOps but we don’t use Sonarcloud for this - Scanner command used when applicable (private details masked)
name: Sonarcloud
on:
pull_request:
paths-ignore:
- 'BTS/Database/**'
jobs:
build:
name: Sonarcloud
runs-on: ubuntu-latest
steps:
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.11
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Install SonarCloud scanner
run: |
dotnet tool install --global dotnet-sonarscanner
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
dotnet-sonarscanner begin /k:"***********" /o:"********" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io"
dotnet build
dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
- Languages of the repository
.NET 6.0/ c#
We also tried applying SONAR_DOTNET_ENABLE_CONCURRENT_EXECUTION: true
but did not see any difference.
Ran the analyzer command based on this blog post I read - The SonarSource guide for investigating the performance of .NET analysis
Here is the analyzer.txt output
analyzer_times.txt (189 KB)