Skip to content

Commit

Permalink
Coverage check
Browse files Browse the repository at this point in the history
  • Loading branch information
EltonCN committed Oct 11, 2024
1 parent 6de6347 commit 01d714e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: Test
on:
push:
branches: [ develop, main ]
branches: [ dev, main ]
pull_request:
branches: [ develop, main ]
branches: [ dev, main ]

jobs:
build:
Expand All @@ -25,9 +25,14 @@ jobs:
run: |
python3 -m pip install --upgrade pip
python3 -m pip install pytest
python3 -m pip install pytest-cov
python3 -m pip install .[tests]
- name: Tests
run: |
pytest
shell: bash
pytest --cov=cst_python --cov-report json
shell: bash

- name: Coverage Check
run: |
python3 tests/check_coverage.py
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
coverage.json

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
8 changes: 8 additions & 0 deletions tests/check_coverage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import json

if __name__ == "__main__":

with open("coverage.json") as file:
coverage_info = json.load(file)

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

0 comments on commit 01d714e

Please sign in to comment.