-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For some reason, the `pytest-cov` plugin undercounts coverage (specifically: not counting top-level statements), while the `coverage` command itself gives correct results.
- Loading branch information
1 parent
4dcb634
commit df94f35
Showing
6 changed files
with
73 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Release | ||
on: workflow_dispatch | ||
|
||
jobs: | ||
release: | ||
name: Release to PyPI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# Make sure the whole repository history is present, so that | ||
# python-semantic-release can decide if a new release is needed. | ||
fetch-depth: 0 | ||
|
||
- uses: relekang/python-semantic-release@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
pypi_token: ${{ secrets.PYPI_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Test and release | ||
|
||
on: | ||
push: | ||
branches: ['master'] | ||
pull_request: | ||
branches: ['master'] | ||
|
||
jobs: | ||
test: | ||
name: Run tests | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
python-version: [3.7, 3.8, 3.9, '3.10', 3.11] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install test dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install -e .[test] coverage[toml] | ||
- name: Run test suite | ||
run: | | ||
# The `pytest-cov` plugin somehow prevents all of the module-level | ||
# statements in this package from being counted as covered. I have | ||
# no idea how; maybe because I use pytest within the package itself? | ||
# Whatever the reason, I get the correct coverage info when I run | ||
# `coverage` directly. | ||
coverage run -m pytest | ||
coverage xml | ||
- name: Report test coverage | ||
uses: codecov/codecov-action@v3 |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.