On GitHub Actions, the scanner is not detecting the lcov report.
I’m using SonarCloud and your official Github Action SonarSource/sonarcloud-github-action@master
on the last version.
I’m generating the lcov report for test coverage, and the scanner is indicating the report doesn’t exist, even though I check if the file is on the right spot and its content is right.
Run ls -l coverage/packages/ngx-deploy-npm
total 8
drwxr-xr-x 5 runner docker 4096 Jan 29 23:56 lcov-report
-rw-r--r-- 1 runner docker 3538 Jan 29 23:56 lcov.info
Run cat coverage/packages/ngx-deploy-npm/lcov.info
TN:
SF:src/core/index.ts
FNF:0
FNH:0
DA:1,3
LF:1
LH:1
BRF:0
BRH:0
end_of_record
TN:
.
.
.
Scanner Error:
INFO: Sensor JavaScript/TypeScript Coverage [javascript]
INFO: No LCOV files were found using coverage/packages/ngx-deploy-npm/lcov.info
WARN: No coverage information will be saved because all LCOV files cannot be found.
Here is the full output
steps to reproduce
On GitHub actions, using SonarSource/sonarcloud-github-action@master
- Inidcate on
sonar-project.properties
to find the lcov report oncoverage/packages/ngx-deploy-npm/lcov.info
- Generate the lcov report
- Verify if the file
coverage/packages/ngx-deploy-npm/lcov.info
exits - Launch the sonnar scanner using
-
- name: SonarCloud Scan uses: SonarSource/sonarcloud-github-action@master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any SONAR_TOKEN: ${{ secrets.SONARQUBE_SCANNER }} with: args: > -Dsonar.pullrequest.key=${{ github.env.PR_NUMBER }}
-
- See the error indicating the lcov report doesn’t exist
I tested my configuration locally with dockerized server and scanner, and everything is running as expected.
I see no potential workaround.