File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change 1+ name : CodeCoverage
2+
3+ on : [push, pull_request, workflow_dispatch]
4+
5+ jobs :
6+ run :
7+ runs-on : [ubuntu-24.04]
8+
9+ strategy :
10+ matrix :
11+ python-versions : ['3.12']
12+
13+ steps :
14+ - uses : actions/checkout@v4
15+ - name : Set up Python ${{ matrix.python-versions }}
16+ uses : actions/setup-python@v4
17+ with :
18+ python-version : ${{ matrix.python-versions }}
19+ - name : setup
20+ run : |
21+ sudo apt update && sudo apt install --yes \
22+ libcdd-dev \
23+ libgmp-dev \
24+ numdiff \
25+ texlive \
26+ texlive-latex-extra
27+ python -m pip install --upgrade pip
28+ pip install pycddlib autograd # this is optional
29+ pip install coverage
30+ python --version
31+ - name : Generate Report
32+ run : |
33+ python -m pip install git+https://github.com/geodynamics/burnman@main
34+ coverage run -m unittest discover ./tests
35+ main_coverage=$(coverage report --precision=7 --format=total)
36+ python -m pip install -q -e .[dev]
37+ coverage run -m unittest discover ./tests
38+ coverage report
39+ new_coverage=$(coverage report --precision=7 --format=total)
40+ echo "Main coverage: $main_coverage"
41+ echo "New coverage: $new_coverage"
42+ if (( $(echo "$new_coverage < $main_coverage" | bc -l) )); then
43+ echo "Coverage decreased relative to main"
44+ exit 1
45+ fi
You can’t perform that action at this time.
0 commit comments