Skip to content

Commit 23eefa8

Browse files
[py] Run type checks in CI and report typing coverage to codecov (#9523)
* [py] add github action for type checking Signed-off-by: oleg.hoefling <[email protected]> * temporarily enable running CI from CI/branchname Signed-off-by: oleg.hoefling <[email protected]> * ignore mypy exit code Signed-off-by: oleg.hoefling <[email protected]> * allow passing arguments in mypy toxenv, add lxml dependency for cobertura reports Signed-off-by: oleg.hoefling <[email protected]> * record and upload cobertura report in mypy gh action Signed-off-by: oleg.hoefling <[email protected]> * don't write inline comments for dependencies Signed-off-by: oleg.hoefling <[email protected]> * use correct coverage report path to upload to codecov Signed-off-by: oleg.hoefling <[email protected]> Co-authored-by: David Burns <[email protected]>
1 parent e2866fc commit 23eefa8

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

.github/workflows/python.yml

+20
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,26 @@ jobs:
4545
env:
4646
TOXENV: docs
4747

48+
tox_mypy:
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Checkout source tree
52+
uses: actions/checkout@v2
53+
- name: Set up Python 3.7
54+
uses: actions/setup-python@v2
55+
with:
56+
python-version: 3.7.9
57+
- name: Install dependencies
58+
run: |
59+
python -m pip install --upgrade pip
60+
pip install tox==2.4.1
61+
- name: Test with tox
62+
run: |
63+
tox -c py/tox.ini -- --cobertura-xml-report ci || true
64+
bash <(curl -s https://codecov.io/bash) -f py/ci/cobertura.xml
65+
env:
66+
TOXENV: mypy
67+
4868
unit_tests:
4969
runs-on: ubuntu-latest
5070
steps:

py/tox.ini

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,7 @@ commands = flake8 {posargs}
1515

1616
[testenv:mypy]
1717
skip_install = true
18-
deps = mypy
19-
commands = mypy
18+
deps =
19+
mypy
20+
lxml
21+
commands = mypy {posargs}

0 commit comments

Comments
 (0)