3 files changed +21
-10
lines changed Original file line number Diff line number Diff line change 1
1
name : Python
2
2
on : [push, pull_request]
3
3
jobs :
4
- build :
4
+ Pytest :
5
5
runs-on : ubuntu-latest
6
- strategy :
7
- matrix :
8
- python-version : ["3.10", "3.11", "3.12"]
9
6
steps :
10
7
- uses : actions/checkout@v4
11
8
- name : Set up Python ${{ matrix.python-version }}
12
9
uses : actions/setup-python@v5
13
10
with :
14
- python-version : ${{ matrix.python-version }}
11
+ python-version : ' 3.10'
12
+ cache : ' pip'
15
13
- name : Install dependencies
16
14
run : |
17
- python -m pip install --upgrade pip pytest
15
+ python -m pip install --upgrade pip pytest pytest-cov
18
16
pip install .
19
17
- name : Test with pytest
20
18
run : |
21
- pytest tests
19
+ pytest --junitxml=pytest.xml --cov-report "xml:coverage.xml" --cov=git_hg_sync tests/
20
+ ls git_hg_sync
21
+ cat coverage.xml
22
+ - name : Pytest coverage comment
23
+ uses : MishaKav/pytest-coverage-comment@main
24
+ with :
25
+ pytest-xml-coverage-path : coverage.xml
26
+ title : Coverage
27
+ badge-title : Coverage
28
+ junitxml-path : pytest.xml
29
+ junitxml-title : JUnit Xml Summary
Original file line number Diff line number Diff line change 1
1
clones
2
2
.tox
3
3
** /__pycache__ /
4
- config.ini
4
+ config.ini
5
+ .coverage
Original file line number Diff line number Diff line change @@ -8,8 +8,10 @@ setenv = PYTHONPATH = ""
8
8
[testenv:pytest]
9
9
changedir = tests
10
10
passenv = PULSE_PASSWORD
11
- deps = pytest
12
- commands = pytest
11
+ deps =
12
+ pytest
13
+ pytest-cov
14
+ commands = pytest --cov =git_hg_sync --cov-report =html
13
15
14
16
[testenv:lint]
15
17
description = lint source code
0 commit comments