Skip to content

Commit

Permalink
Separate coverage check workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
EltonCN committed Oct 18, 2024
1 parent e3eff24 commit f67ba27
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches: [ dev, main ]

jobs:
build:
test:

runs-on: ${{ matrix.os }}
strategy:
Expand All @@ -33,6 +33,23 @@ jobs:
pytest --cov=cst_python --cov-report json
shell: bash

- if: ${{matrix.os == 'ubuntu-latest' && matrix.python-version == '3.12'}}
name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage_report
path: coverage.json

coverage-check:
runs-on: ubuntu-latest
needs:
- test

steps:
- name: Retrieve coverage report
uses: actions/download-artifact@v4
with:
name: coverage_report
- name: Coverage Check
run: |
python3 tests/check_coverage.py
2 changes: 2 additions & 0 deletions tests/check_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,6 @@
with open("coverage.json") as file:
coverage_info = json.load(file)

print("Coverage:", coverage_info["totals"]["percent_covered"], "%")

assert coverage_info["totals"]["percent_covered"] > 75

0 comments on commit f67ba27

Please sign in to comment.