Skip to content

Commit b2b1507

Browse files
committed
add Python source test coverage GH Action configuration
1 parent 49c2698 commit b2b1507

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

.github/workflows/py-coverage.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Coverage
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest]
11+
python-version: [3.8]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Set up Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
- name: Display Python version & architecture
20+
run: |
21+
python -c "import sys; print(sys.version)"
22+
python -c "import struct; print(struct.calcsize('P') * 8)"
23+
- name: Get pip cache dir
24+
id: pip-cache
25+
run: |
26+
pip install --upgrade pip
27+
echo "::set-output name=dir::$(pip cache dir)"
28+
- name: pip cache
29+
uses: actions/cache@v2
30+
with:
31+
path: ${{ steps.pip-cache.outputs.dir }}
32+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
33+
restore-keys: |
34+
${{ runner.os }}-pip-
35+
- name: Install Python testing dependencies
36+
run: pip install --upgrade pytest
37+
- name: Install Python project dependencies
38+
uses: py-actions/py-dependency-install@v2
39+
with:
40+
update-pip: "true"
41+
update-setuptools: "true"
42+
update-wheel: "true"
43+
- name: Install project
44+
run: pip install .
45+
- name: Generate coverage report
46+
run: |
47+
pip install --upgrade coverage
48+
coverage run --source dehinter -m py.test
49+
coverage report -m
50+
coverage xml
51+
- name: Upload coverage to Codecov
52+
uses: codecov/codecov-action@v1
53+
with:
54+
file: ./coverage.xml

0 commit comments

Comments
 (0)