Sonar cloud Code Coverage report for multi stage pipeline

In my project i have 3 stages in the first stage i have build librarys nad sonar cloud related task and the next two stages i’m running my unit test cases and publish the coverage report, if i see in my pipeline report i can able to see the coverage report, but in my sonar cloud report it shows the coverage as zero.

Hey there.

You would need to move the SonarCloud end task (Run Code Analysis) to after your unit test / coverage report steps.

Build Library in seperate stage/job and Running Unit Test and Code Coverage happen in Seperate Stage/Job, if i add the Sonar Cloud Analysis in seperate stage after complete the unit test i’m getting error, it mentioned it need build data to analysis.