Skip to content

Commit 8c4fe6f

Browse files
author
Chris Privitere
authored
Merge pull request #130 from packethost/coveragev2
add codecov to GH Actions
2 parents 4f307ff + 953b86d commit 8c4fe6f

File tree

5 files changed

+64
-17
lines changed

5 files changed

+64
-17
lines changed

.coveragerc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[run]
2+
branch = True
3+
source = packet
4+
5+
[report]
6+
exclude_lines =
7+
pragma: no cover
8+
def __repr__
9+
if .debug:
10+
raise NotImplementedError
11+
if __name__ == .__main__.:
12+
ignore_errors = True
13+
omit =
14+
.tox/*
15+
test/*
16+
setup.py
17+

.github/workflows/test.yml

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
strategy:
1111
matrix:
1212
python-version:
13-
- 3.8
13+
- '3.10'
1414

1515
steps:
1616
- uses: actions/checkout@v2
@@ -30,19 +30,35 @@ jobs:
3030
matrix:
3131
python-version:
3232
- 2.7
33-
- 3.6
34-
- 3.7
3533
- 3.8
3634
- 3.9
35+
- '3.10'
3736

3837
steps:
3938
- uses: actions/checkout@v2
4039
- name: Set up Python ${{ matrix.python-version }}
4140
uses: actions/setup-python@v2
4241
with:
4342
python-version: ${{ matrix.python-version }}
44-
- id: test
43+
- name: Install Dependencies
4544
run: |
4645
python -m pip install --upgrade setuptools pip wheel
4746
pip install tox tox-gh-actions
47+
- name: Test with tox
48+
run: |
4849
tox
50+
find . # TODO: remove this
51+
# - name: Upload coverage.xml
52+
# if: ${{ matrix.python-version == '3.10' }}
53+
# uses: actions/upload-artifact@v2
54+
# with:
55+
# name: tox-gh-actions-coverage
56+
# path: coverage.xml
57+
# if-no-files-found: error
58+
- uses: codecov/codecov-action@v2
59+
if: ${{ matrix.python-version == '3.10' }}
60+
with:
61+
flags: unittests # optional
62+
name: codecov-umbrella # optional
63+
fail_ci_if_error: true # optional (default = false)
64+
verbose: true # optional (default = false)

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ htmlcov/
4545
.cache
4646
nosetests.xml
4747
coverage.xml
48+
unittest_*.xml
4849
*,cover
4950
.hypothesis/
5051

test/.coveragerc

Lines changed: 0 additions & 8 deletions
This file was deleted.

tox.ini

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,46 @@
22

33
[tox]
44

5-
envlist = py27,py36,py37,py38,py39
5+
envlist = py27,py38,py39,py310
66
skip_missing_interpreters=True
77

8+
[tool:pytest]
9+
testpaths = test
10+
# addopts =
11+
812
[gh-actions]
913
python =
1014
2.7: py27
11-
3.6: py36
12-
3.7: py37
13-
3.8: py38, mypy
15+
3.8: py38
1416
3.9: py39
17+
3.10: py310, mypy
1518

1619
[testenv]
20+
usedevelop=True
1721
setenv =
1822
PACKET_AUTH_TOKEN = {env:PACKET_AUTH_TOKEN:}
1923

2024
deps =
2125
pytest
26+
coverage
2227
pytest-cov
2328
requests_mock
2429

2530
commands=
26-
py.test -v --cov {envsitepackagesdir}/packet --cov-report=term-missing test
31+
py.test --cov-append --cov-report=term-missing --cov packet --cov-report xml:{envdir}/../../coverage.xml --junitxml=unittest_{envname}.xml {posargs:-vv}
32+
33+
depends =
34+
{py39}: clean
35+
report: py39
36+
37+
[testenv:report]
38+
deps = coverage
39+
skip_install = true
40+
commands =
41+
coverage report
42+
coverage xml:coverage.xml
43+
44+
[testenv:clean]
45+
deps = coverage
46+
skip_install = true
47+
commands = coverage erase

0 commit comments

Comments
 (0)