Integrate codecov.io
We publish the test coverage reporting to codecov.io
This commit is contained in:
parent
5518837cbc
commit
3f8b5cb146
4 changed files with 23 additions and 1 deletions
2
.github/workflows/test_coverage.yml
vendored
2
.github/workflows/test_coverage.yml
vendored
|
@ -27,3 +27,5 @@ jobs:
|
|||
# one for each of the above Python versions,
|
||||
# before all results are collected together
|
||||
- run: nox -s test-coverage
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
|
|
@ -9,6 +9,7 @@ The goal of the `lalib` project is to create
|
|||
|
||||
|
||||
[](https://github.com/webartifex/lalib/actions/workflows/tests.yml)
|
||||
[](https://codecov.io/github/webartifex/lalib)
|
||||
[](https://github.com/psf/black)
|
||||
[](https://mypy-lang.org/)
|
||||
[](https://github.com/astral-sh/ruff)
|
||||
|
|
16
noxfile.py
16
noxfile.py
|
@ -1,6 +1,7 @@
|
|||
"""Maintenance tasks run in isolated environments."""
|
||||
|
||||
import collections
|
||||
import os
|
||||
import pathlib
|
||||
import random
|
||||
import re
|
||||
|
@ -311,7 +312,20 @@ def test_coverage_report(session: nox.Session) -> None:
|
|||
install_pinned(session, "coverage")
|
||||
|
||||
session.run("python", "-m", "coverage", "combine")
|
||||
session.run("python", "-m", "coverage", "report", "--fail-under=100")
|
||||
|
||||
if codecov_token := os.environ.get("CODECOV_TOKEN"):
|
||||
install_unpinned(session, "codecov-cli")
|
||||
session.run("python", "-m", "coverage", "xml", "--fail-under=0")
|
||||
session.run(
|
||||
"codecovcli",
|
||||
"upload-process",
|
||||
"--fail-on-error",
|
||||
"--file=.cache/coverage/report.xml",
|
||||
f"--token={codecov_token}",
|
||||
)
|
||||
|
||||
else:
|
||||
session.run("python", "-m", "coverage", "report", "--fail-under=100")
|
||||
|
||||
|
||||
@nox_session(name="test-docstrings", python=MAIN_PYTHON)
|
||||
|
|
|
@ -131,6 +131,11 @@ parallel = true
|
|||
source = ["lalib"]
|
||||
|
||||
|
||||
[tool.coverage.xml]
|
||||
|
||||
output = ".cache/coverage/report.xml"
|
||||
|
||||
|
||||
|
||||
[tool.flake8]
|
||||
|
||||
|
|
Loading…
Reference in a new issue