@@ -3,48 +3,54 @@ name: Unit tests
3
3
on : [push, pull_request]
4
4
5
5
jobs :
6
- test_py2 :
7
- runs-on : ubuntu-20.04
6
+ test :
7
+ strategy :
8
+ matrix :
9
+ include :
10
+ - pyversion : ' 2.7'
11
+ os : ubuntu-20.04
12
+ - pyversion : ' 3'
13
+ os : ubuntu-latest
14
+ runs-on : ${{ matrix.os }}
8
15
9
16
steps :
10
17
- uses : actions/checkout@v2
11
18
with :
12
19
fetch-depth : 0
13
- - name : Set up Python 2.7
20
+ - name : Set up Python ${{ matrix.pyversion }}
14
21
uses : actions/setup-python@v2
15
22
with :
16
- python-version : ' 2.7 '
23
+ python-version : ${{ matrix.pyversion }}
17
24
18
25
- name : Install dependencies
19
26
run : |
20
27
python -m pip install --upgrade pip
21
28
pip install -r requirements-dev.txt
22
29
# FIXME: branding.py still has no permanent home
23
30
curl https://gist.github.com/ydirson/3c36a7e19d762cc529a6c82340894ccc/raw/5ca39f621b1feab813e171f535c1aad1bd483f1d/branding.py -O -L
24
- pip install pyliblzma
25
31
pip install -e .
26
32
command -v xz
27
33
28
34
- name : Test
29
35
run : |
30
36
pytest --cov -rP
31
37
coverage xml
32
- coverage html
33
- coverage html -d htmlcov-tests --include="tests/*"
34
- diff-cover --html-report coverage-diff.html coverage.xml
38
+ coverage html -d htmlcov-${{ matrix.pyversion }}
39
+ coverage html -d htmlcov-tests-${{ matrix.pyversion }} --include="tests/*"
40
+ diff-cover --compare-branch=origin/master -- html-report coverage-diff-${{ matrix.pyversion }} .html coverage.xml
35
41
36
42
- name : Pylint
37
43
run : |
38
44
pylint --version
39
45
pylint --exit-zero xcp/ tests/ setup.py
40
46
pylint --exit-zero --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" xcp/ tests/ setup.py > pylint.txt
41
- diff-quality --violations=pylint --html-report pylint-diff.html pylint.txt
47
+ diff-quality --compare-branch=origin/master -- violations=pylint --html-report pylint-diff-${{ matrix.pyversion }} .html pylint.txt
42
48
43
49
- uses : actions/upload-artifact@v3
44
50
with :
45
51
name : Coverage and pylint reports
46
52
path : |
47
- coverage-diff.html
48
- pylint-diff.html
49
- htmlcov
50
- htmlcov-tests
53
+ coverage-diff-${{ matrix.pyversion }} .html
54
+ pylint-diff-${{ matrix.pyversion }} .html
55
+ htmlcov-${{ matrix.pyversion }}
56
+ htmlcov-tests-${{ matrix.pyversion }}
0 commit comments