Hi,
I am getting same errors, since yesterday on GitHub Actions. I’m using Sonar for a solution based only on .NET 5 and it’s failing on a front end project for Angular SPA. If it also matters, I’m using Docker for the whole thing.
I replaced the sensitive data with ProjectName
/home/runner/work/ProjectName/ProjectName/.sonarqube/bin/targets/SonarQube.Integration.targets(405,5): error MSB3677: Unable to move file "/home/runner/work/ProjectName/ProjectName/.sonarqube/out/47/ProjectInfo.xml" to "/ProjectInfo.xml". Access to the path '/ProjectInfo.xml' is denied. [/home/runner/work/ProjectName/ProjectName/src/Frontend/ProjectName.Frontend.Web.csproj]
72 Warning(s)
1 Error(s)
Time Elapsed 00:02:36.24
My project structure looks like this:
I’m collecting coverage from integration and unit tests projects.
This is my workflow file:
name: (Backend) SonarQube analysis
on:
workflow_dispatch:
push:
branches:
- develop
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build
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
- name: Install SonarCloud scanner
shell: bash
run: |
dotnet tool install --global dotnet-sonarscanner
- name: Setup infrastructure
shell: bash
run: |
pushd .
cd ./src
docker-compose up -d mariadb postgres
sleep 20
tar -xvf ./Backups/frontendV2.tar.gz
docker exec -i MariaDB mysql -uroot -proot frontendV2 < ./frontendV2/frontendV2.sql
popd
- name: Build and analyze
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
DOTNET_HOSTBUILDER__RELOADCONFIGONCHANGE: false # Disable config files watch https://stackoverflow.com/a/67111195/8065832
shell: bash
run: |
dotnet sonarscanner begin /k:"ProjectName" /o:"ProjectName" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.opencover.reportsPaths="./src/Tests/ProjectName.UnitTests/coverage.opencover.xml,./src/Tests/ProjectName.IntegrationTests/coverage.opencover.xml" /d:sonar.coverage.exclusions="./src/Tests/*.cs"
dotnet test ./src/Tests/ProjectName.UnitTests/ProjectName.UnitTests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
dotnet test ./src/Tests/ProjectName.IntegrationTests/ProjectName.IntegrationTests.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
dotnet build ./src/ProjectName.sln
dotnet sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
I’ve tried re-adding the frontend project to the solution file, so it is at the very end of project list, but that didn’t help. Any ideas why it is failing?