File tree 4 files changed +34
-4
lines changed
4 files changed +34
-4
lines changed Original file line number Diff line number Diff line change
1
+ codecov :
2
+ require_ci_to_pass : yes
3
+
4
+ coverage :
5
+ precision : 2
6
+ round : down
7
+ range : " 70...100"
8
+
9
+ status :
10
+ project : yes
11
+ patch : yes
12
+ changes : no
13
+
14
+ comment :
15
+ layout : " reach, diff, flags, files"
16
+ behavior : default
17
+ require_changes : true # if true: only post the comment if coverage changes
18
+ require_base : no # [yes :: must have a base report to post]
19
+ require_head : yes # [yes :: must have a head report to post]
20
+ branches : null # branch names that can post comment
Original file line number Diff line number Diff line change 22
22
python -m pip install --upgrade pip
23
23
pip install -r requirements.txt
24
24
pip install -r requirements-dev.txt
25
- - name : pytest
25
+ - name : Run tests and generate reports
26
26
run : make test
27
+ - name : Upload coverage to Codecov
28
+ uses : codecov/codecov-action@v1
29
+ if : matrix.python-version == 3.7
30
+ with :
31
+ token : ${{ secrets.CODECOV_TOKEN }}
32
+ file : ./coverage.xml
33
+ name : codecov-umbrella
34
+ yml : ./.codecov.yml
35
+ fail_ci_if_error : true
Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ black: # Format code in-place using black.
69
69
70
70
.PHONY : test
71
71
test : # Test code using pytest.
72
- pytest -v littlemcmc tests --doctest-modules --html=testing-report.html --self-contained-html
72
+ pytest -v littlemcmc tests --doctest-modules --html=testing-report.html --self-contained-html --cov=./ --cov-report=xml
73
73
74
74
.PHONY : lint
75
75
lint : blackstyle pylintstyle pydocstyle mypytypes # Lint code using black, pylint, pydocstyle and mypy.
@@ -79,7 +79,7 @@ check: lint test # Both lint and test code. Runs `make lint` followed by `make
79
79
80
80
.PHONY : clean
81
81
clean : # Clean project directories.
82
- rm -rf dist/ site/ littlemcmc.egg-info/ pip-wheel-metadata/ __pycache__/ testing-report.html
82
+ rm -rf dist/ site/ littlemcmc.egg-info/ pip-wheel-metadata/ __pycache__/ coverage.xml
83
83
find littlemcmc/ tests/ -type d -name " __pycache__" -exec rm -rf {} +
84
84
find littlemcmc/ tests/ -type d -name " __pycache__" -delete
85
85
find littlemcmc/ tests/ -type f -name " *.pyc" -delete
Original file line number Diff line number Diff line change 2
2
3
3
![ Tests Status] ( https://github.com/eigenfoo/littlemcmc/workflows/tests/badge.svg )
4
4
![ Lint Status] ( https://github.com/eigenfoo/littlemcmc/workflows/lint/badge.svg )
5
- ![ License] ( https://img.shields.io/github/license/eigenfoo/littlemcmc )
5
+ [ ![ Coverage Status] ( https://codecov.io/gh/eigenfoo/littlemcmc/branch/master/graph/badge.svg )] ( https://codecov.io/gh/eigenfoo/littlemcmc )
6
+ [ ![ License] ( https://img.shields.io/github/license/eigenfoo/littlemcmc )] ( https://github.com/eigenfoo/littlemcmc/blob/master/LICENSE.littlemcmc.txt )
6
7
7
8
> littlemcmc   ;   ; /lɪtəl ɛm si ɛm si/   ;   ; _ noun_
8
9
>
You can’t perform that action at this time.
0 commit comments