Skip to content

Commit

Permalink
Add coverage to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanPlasse committed Oct 29, 2022
1 parent 752409c commit bd16465
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
7 changes: 3 additions & 4 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
branch = True
source = src/

omit =
archive/*
*/.local/*
# Do not omit tests folder as the tests coverage could not be 100%

[report]
# Regexes for lines to exclude from consideration
Expand All @@ -25,7 +23,8 @@ exclude_lines =
if 0:
if __name__ == .__main__.:

ignore_errors = True
# Don't complain about function overloading
@overload

[html]
directory = coverage_html_report
33 changes: 23 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,31 @@ jobs:

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- run: pip install .[full,tests,lint]
- name: Install tests and lint dependencies
run: pip install .[tests,lint]

- run: flake8
- run: mypy
- name: Lint
run: flake8
- name: Type check
run: mypy

- run: pytest
# codecov coverage
# - run: pip install codecov pytest-cov
# - run: pytest --cov --cov-report=xml
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v1
- name: Test stdlib
run: pytest --cov=src --cov-report=xml

- name: Install NumPy
run: pip install numpy
- name: Test with NumPy
run: pytest --cov=src --cov-report=xml --cov-append

- name: Install full dependencies
run: pip install .[full]
- name: Test with full dependencies
run: pytest --cov=src --cov-report=xml --cov-append

- name: Upload coverage
uses: codecov/codecov-action@v3
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ pymap3d = py.typed
[options.extras_require]
tests =
pytest
pytest-cov
lint =
flake8
flake8-bugbear
Expand All @@ -55,5 +56,6 @@ full =
numpy >= 1.10.0
astropy
xarray
pandas
testproj =
pyproj

0 comments on commit bd16465

Please sign in to comment.