Skip to content

Commit

Permalink
Fix #48: Missing coverage reports in SonarCloud (#52)
Browse files Browse the repository at this point in the history
After the change to use relative paths when running coverage, the
override coverage source paths for SonarCloud in test.yml needed
to be updated.
  • Loading branch information
arneso-ssb authored Jan 25, 2024
1 parent d5bfd5a commit 58ce65e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions {{cookiecutter.project_name}}/.github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
subprocess.run(cmd, shell=True)
- name: Restore pre-commit cache
uses: actions/cache@v3
uses: actions/cache@v4
if: matrix.session == 'pre-commit'
with:
path: ~/.cache/pre-commit
Expand Down Expand Up @@ -157,7 +157,9 @@ jobs:
# Need to fix coverage source paths for SonarCloud scanning in GitHub actions.
# Replace root path with /github/workspace (mounted in docker container).
- name: Override coverage source paths for SonarCloud
run: sed -i "s/<source>\/home\/runner\/work\/{{cookiecutter.project_name}}\/{{cookiecutter.project_name}}/<source>\/github\/workspace/g" coverage.xml
run: |
sed -i "s/<source><\/source>/<source>\/github\/workspace<\/source>/g" coverage.xml
sed -i "s/<source>tests/<source>\/github\/workspace\/tests/g" coverage.xml
- name: SonarCloud Scan
env:
Expand Down

0 comments on commit 58ce65e

Please sign in to comment.