From 58ce65ed743f056ce0d42537d37fef5d041ead22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arne=20S=C3=B8rli?= <81353974+arneso-ssb@users.noreply.github.com> Date: Thu, 25 Jan 2024 17:32:39 +0100 Subject: [PATCH] Fix #48: Missing coverage reports in SonarCloud (#52) After the change to use relative paths when running coverage, the override coverage source paths for SonarCloud in test.yml needed to be updated. --- {{cookiecutter.project_name}}/.github/workflows/tests.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/tests.yml b/{{cookiecutter.project_name}}/.github/workflows/tests.yml index 7e4136b5d..0674594e2 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/tests.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/tests.yml @@ -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 @@ -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/\/home\/runner\/work\/{{cookiecutter.project_name}}\/{{cookiecutter.project_name}}/\/github\/workspace/g" coverage.xml + run: | + sed -i "s/<\/source>/\/github\/workspace<\/source>/g" coverage.xml + sed -i "s/tests/\/github\/workspace\/tests/g" coverage.xml - name: SonarCloud Scan env: