Skip to content

Commit c7418ff

Browse files
authored
Merge branch 'main' into main
2 parents 85c6441 + 07f167c commit c7418ff

File tree

4 files changed

+28
-1
lines changed

4 files changed

+28
-1
lines changed

.codecov.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
target: 90%

.coveragerc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[run]
2+
omit =
3+
./noxfile.py
4+
[report]
5+
exclude_lines =
6+
pragma: no cover
7+
if __name__ == .__main__.:

.github/workflows/main.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ jobs:
1919
- run: python -m pip install flake8 nox poetry
2020
- run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
2121
- run: python -m nox
22+
env:
23+
OS: ${{ matrix.os }}
24+
PYTHON: ${{ matrix.python-version }}
25+

noxfile.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
"""Nox sessions."""
2+
from os import environ
23
from typing import Any
34

45
import nox
56
from nox.sessions import Session
67

78
nox.options.sessions = ["tests"]
9+
if environ.get("CI", None) == "true":
10+
nox.options.sessions.append("coverage")
811
locations = "src", "tests", "noxfile.py", "docs/conf.py"
912

1013

@@ -41,9 +44,17 @@ def tests(session: Session) -> None:
4144
session,
4245
"pytest",
4346
"pytest-black",
47+
"pytest-cov",
4448
"pytest-isort",
4549
"pytest-mypy",
4650
"types-requests",
4751
"types-orjson",
4852
)
49-
session.run("pytest")
53+
session.run("pytest", "--cov=./", "--cov-report=xml")
54+
55+
56+
@nox.session
57+
def coverage(session: Session) -> None:
58+
"""Upload coverage data."""
59+
install_with_constraints(session, "codecov")
60+
session.run("codecov", "--env", "OS", "PYTHON")

0 commit comments

Comments
 (0)