Skip to content

Commit

Permalink
Add coverage upload workflow
Browse files Browse the repository at this point in the history
Because of credentials needed to upload to Codacy we need to add a
separate workflow which is executed in the context of the target
repository to see the credentials for uploading
  • Loading branch information
Spacetown committed Aug 17, 2024
1 parent 239ca42 commit f2ba362
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/gcovr-ci-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ jobs:
name: "diffs-${{ inputs.container && format('docker-{0}', inputs.gcc) || format('{0}-{1}-{2}', inputs.os, inputs.gcc, inputs.python-version) }}"
path: tests/diff.zip

- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: "coverage-${{ inputs.container && format('docker-{0}', inputs.gcc) || format('{0}-{1}-{2}', inputs.os, inputs.gcc, inputs.python-version) }}"
path: ./coverage.xml

- name: Upload coverage to Codecov
if: ${{ (github.repository == 'gcovr/gcovr') && (env.USE_COVERAGE == 'true') }}
uses: codecov/codecov-action@v4
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/upload_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Upload coverage

on:
workflow_run:
workflows: ['Run GCOVR Ci']
types:
- completed

jobs:
upload:
runs-on: ubuntu-22.04
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
pattern: coverage-*
run-id: ${{github.event.workflow_run.id }}


- name: List the artifacts
run: |
ls -alR .

0 comments on commit f2ba362

Please sign in to comment.