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
|
|||
|
||||
|
||||
[![Test suite: Status](https://github.com/webartifex/lalib/actions/workflows/tests.yml/badge.svg)](https://github.com/webartifex/lalib/actions/workflows/tests.yml)
|
||||
[![Test coverage: codecov](https://codecov.io/github/webartifex/lalib/graph/badge.svg?token=J4LWOMVP0R)](https://codecov.io/github/webartifex/lalib)
|
||||
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
|
||||
[![Type checking: mypy](https://www.mypy-lang.org/static/mypy_badge.svg)](https://mypy-lang.org/)
|
||||
[![Code linting: ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](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