Skip to content

Commit 25326e7

Browse files
committed
CI: also run tests with python3
diff-cover defaults to origin/main in new version, it seems. Signed-off-by: Yann Dirson <[email protected]>
1 parent 2b3a24e commit 25326e7

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

.github/workflows/main.yml

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,54 @@ name: Unit tests
33
on: [push, pull_request]
44

55
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 }}
815

916
steps:
1017
- uses: actions/checkout@v2
1118
with:
1219
fetch-depth: 0
13-
- name: Set up Python 2.7
20+
- name: Set up Python ${{ matrix.pyversion }}
1421
uses: actions/setup-python@v2
1522
with:
16-
python-version: '2.7'
23+
python-version: ${{ matrix.pyversion }}
1724

1825
- name: Install dependencies
1926
run: |
2027
python -m pip install --upgrade pip
2128
pip install -r requirements-dev.txt
2229
# FIXME: branding.py still has no permanent home
2330
curl https://gist.github.com/ydirson/3c36a7e19d762cc529a6c82340894ccc/raw/5ca39f621b1feab813e171f535c1aad1bd483f1d/branding.py -O -L
24-
pip install pyliblzma
2531
pip install -e .
2632
command -v xz
2733
2834
- name: Test
2935
run: |
3036
pytest --cov -rP
3137
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
3541
3642
- name: Pylint
3743
run: |
3844
pylint --version
3945
pylint --exit-zero xcp/ tests/ setup.py
4046
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
4248
4349
- uses: actions/upload-artifact@v3
4450
with:
4551
name: Coverage and pylint reports
4652
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 }}

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ future
1111

1212
# python-2.7 only
1313
configparser ; python_version < "3.0"
14+
pyliblzma ; python_version < "3.0"

0 commit comments

Comments
 (0)