Sonarcloud code coverage dont show up with github action

  • ALM used (GitHub)
  • CI system used (Github Actions)
  • Scanner command used when applicable (standar command github action)
  • Languages of the repository: Typescript
  • No Error but didnt show up codecoverage
  • sonar-project.properties
sonar.projectKey=<key>
sonar.organization=<org<
sonar.sourceEncoding=UTF-8
sonar.host.url=https://sonarcloud.io
sonar.sources=src/app
sonar.tests=src/tests
sonar.language=typescript
sonar.javascript.lcov.reportPaths=coverage/lcov.info

one of repo use this config can show up codecoverage but in this repo cannot see codecoverage

  • github action command
  1. npm install
    2.npm run test using mocha that generated lcov.info in my local there is code coverage
    why this is happen ?

Hello Anjar,

Thank you for your message, and welcome to the SonarSource community!

In order to help you, would you mind sharing the scanner logs with the debug details? There might be some clues there as why SonarCloud doesn’t show your code coverage.

Regards,
Yassin

Hi @Yassin_Kammoun ,

I already find the solution because inside lcov.info there is a path directory github actions,

therefore sonarcloud cannot read that, so i erase path directory before sonarcloud analyze command

Thank you,
Regards,

Anjar Daniswara

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.