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
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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue