Skip to content

Commit

Permalink
[py] Run type checks in CI and report typing coverage to codecov (#9523)
Browse files Browse the repository at this point in the history
* [py] add github action for type checking

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* temporarily enable running CI from CI/branchname

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* ignore mypy exit code

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* allow passing arguments in mypy toxenv, add lxml dependency for cobertura reports

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* record and upload cobertura report in mypy gh action

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* don't write inline comments for dependencies

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>

* use correct coverage report path to upload to codecov

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>


Co-authored-by: David Burns <david.burns@theautomatedtester.co.uk>
  • Loading branch information
hoefling and AutomatedTester authored Jul 16, 2021
1 parent e2866fc commit 23eefa8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,26 @@ jobs:
env:
TOXENV: docs

tox_mypy:
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: 3.7.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox==2.4.1
- name: Test with tox
run: |
tox -c py/tox.ini -- --cobertura-xml-report ci || true
bash <(curl -s https://codecov.io/bash) -f py/ci/cobertura.xml
env:
TOXENV: mypy

unit_tests:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 4 additions & 2 deletions py/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ commands = flake8 {posargs}

[testenv:mypy]
skip_install = true
deps = mypy
commands = mypy
deps =
mypy
lxml
commands = mypy {posargs}

0 comments on commit 23eefa8

Please sign in to comment.