diff --git a/.github/workflows/cmake-gcc.yml b/.github/workflows/cmake-gcc.yml index ce4859f..c78803b 100644 --- a/.github/workflows/cmake-gcc.yml +++ b/.github/workflows/cmake-gcc.yml @@ -46,7 +46,14 @@ jobs: python3 -m pip install --upgrade pip python3 -m pip install gcovr gcovr --version - gcovr -r . --gcov-executable gcov-${{env.GCC_VERSION}} --object-directory ${{env.BUILD_DIR}} --exclude 'test/.*' --exclude '3p/.*' --lcov -o coverage.info + gcovr \ + --root "$GITHUB_WORKSPACE" \ + --gcov-executable gcov-${{env.GCC_VERSION}} \ + --object-directory ${{env.BUILD_DIR}} \ + --exclude 'test/.*' \ + --exclude '3p/.*' \ + --xml \ + -o coverage.xml - name: Upload coverage to Codecov if: ${{matrix.build_type == 'Debug' && github.event_name != 'pull_request'}} @@ -54,7 +61,7 @@ jobs: with: fail_ci_if_error: true verbose: true - files: coverage.info + files: coverage.xml token: ${{ secrets.CODECOV_TOKEN }} - name: Store coverage for fork PR upload @@ -62,4 +69,4 @@ jobs: uses: actions/upload-artifact@v4 with: name: coverage - path: coverage.info + path: coverage.xml diff --git a/.github/workflows/codecov-pr.yml b/.github/workflows/codecov-pr.yml index 2b82cf4..d2d4f7e 100644 --- a/.github/workflows/codecov-pr.yml +++ b/.github/workflows/codecov-pr.yml @@ -23,12 +23,18 @@ jobs: repository: ${{github.repository}} run-id: ${{github.event.workflow_run.id}} + - name: Checkout pull request source + uses: actions/checkout@v4 + with: + repository: ${{github.event.workflow_run.head_repository.full_name}} + ref: ${{github.event.workflow_run.head_sha}} + - name: Upload coverage to Codecov uses: codecov/codecov-action@v5 with: fail_ci_if_error: true verbose: true - files: coverage/coverage.info + files: coverage/coverage.xml token: ${{secrets.CODECOV_TOKEN}} override_commit: ${{github.event.workflow_run.head_sha}} override_pr: ${{github.event.workflow_run.pull_requests[0].number}}