Skip to content

Commit

Permalink
Add Code-Coverage CI Job (#34)
Browse files Browse the repository at this point in the history
* Add Code-Coverage CI Job

Configure code coverage to post the test coverage status on PR
Closes: #28
  • Loading branch information
pankajastro authored Aug 9, 2024
1 parent e871afb commit 0e54ba3
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,36 @@ jobs:
if: always()
run: |
gcloud container clusters delete ${{ steps.cluster-name.outputs.name }} --zone us-central1-a --quiet
Code-Coverage:
if: github.event.action != 'labeled'
needs:
- Run-Unit-Tests
- Run-Integration-Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install coverage
run: |
pip3 install coverage
- name: Download all coverage artifacts
uses: actions/download-artifact@v4
with:
path: ./coverage
- name: Combine coverage
run: |
coverage combine ./coverage/coverage*/.coverage
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml

0 comments on commit 0e54ba3

Please sign in to comment.