Reputation: 840
I followed the tutorial and set an actual Github action instead of the automatic analysis, I also added sonar.javascript.lcov.reportPaths=coverage/lcov.info
in the sonar-project.properties.
Running the command in my machine I can see that the lcon.info exists in the correct location, the sonarCloud action do run and I can see the results as normal, but it doesn't display coverage it keeps showing this:
sonarcloud:
name: SonarCloud
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
needs: [report-coverage]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: actions/download-artifact@v3
with:
name: coverage-artifacts
path: coverage
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
What am I missing?
Upvotes: 1
Views: 124
Reputation: 1
I have had the same issue, turns out the checkout was deleting the file before it had the time to analyse it. You should double check the location of the file and check what's been deleted in the checkout. Although this might not resolve your issue. What I have done to resolve it is that i have uploaded the lcov file as an artefact if the pipeline during my test, then, i downloaded it at the root of my project during the Sonar Cloud stage and double checked its location multiple times before it worked.
Upvotes: 0