# SonarScan not reading code coverage from github actions

**URL:** <https://community.sonarsource.com/t/sonarscan-not-reading-code-coverage-from-github-actions/86132>\
**Category:** SonarQube Cloud\
**Tags:** github-actions, coverage\
**Created:** [March 18, 2023, 12:32am UTC](https://community.sonarsource.com/t/sonarscan-not-reading-code-coverage-from-github-actions/86132 "2023-03-18T00:32:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbougs](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jbougs/32/41974_2.png) [@jbougs](https://community.sonarsource.com/u/jbougs)\
**Post date:** [March 18, 2023, 12:32am UTC](https://community.sonarsource.com/t/sonarscan-not-reading-code-coverage-from-github-actions/86132/1 "2023-03-18T00:32:08Z")

</div>

i have a github action where the test step is run inside a container like this:

(non-important bits removed)

```yaml
test:
    needs: [build-and-push, setup-context]
    name: Lint-Typecheck-Migrations-Tests
    runs-on: ubuntu-latest
    container:
      image: my-container
    steps:
      - name: Check out current project
        uses: actions/checkout@v3
        with:
          submodules: recursive
          ssh-key: ${{ env.AVANTBOT_SSH_KEY }}
      - name: test
        run: |
          cd /code
          coverage run manage.py test
          coverage xml
          sed -i "s/<source>.*<\/source>/<source>\/github\/workspace\/app<\/source>/g" coverage.xml
          head coverage.xml
      - name: SonarCloud Scan
        uses: SonarSource/sonarcloud-github-action@master
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

```

the SonarCloud Scan (which runs in its own container) is not picking up the coverage.xml file that is generated by the coverage command.

the coverage path is specified as `sonar.python.coverage.reportPaths = **/coverage.xml`

i have a feeling its because the action is run inside a container on the github hosted runner and then sonarcloud runs in its own container.

how do i get sonarcloud to see the coverage file that was generated in the previous step?

---

<div class="post-metadata">

**Author:** ![Colin](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/colin/32/55255_2.png) [@Colin](https://community.sonarsource.com/u/Colin)\
**Post date:** [March 20, 2023, 8:23am UTC](https://community.sonarsource.com/t/sonarscan-not-reading-code-coverage-from-github-actions/86132/2 "2023-03-20T08:23:01Z")

</div>

Hey there.

[You can use the Github Actions upload-artifact and download-artifact to share data between jobs.](https://stackoverflow.com/questions/57498605/github-actions-share-workspace-artifacts-between-jobs).

And if you still have trouble, I suggest checking out this post:

> [@How to find logs about importing code coverage](https://community.sonarsource.com/t/how-to-find-logs-about-importing-code-coverage/73317):
>
> When coverage data isn’t appearing as expected in SonarQube Server / Community Build or SonarQube Cloud, the first place you should look is the scanner logs. Where do I find the scanner logs?warning This will likely be broken out into its own guide soon The Scanner logs are the output of executing one of the [scanners](https://docs.sonarqube.org/latest/analysis/overview/), either directly or wrapped by one of many integrations, such as the [SonarScanner for Jenkins](https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-jenkins/), [SonarScanner for Azure DevOps](https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-azure-devops/), [SonarQube](https://github.com/SonarSource/sonarqube-scan-action)/[SonarCloud](https://github.com/marketplace/actions/sonarcloud-scan) GitHub Actions or [SonarQube](https://bitbucket.org/sonarsource/sonarqube-scan/src/master/) /…
