Skip to content
This repository was archived by the owner on Feb 17, 2021. It is now read-only.

Commit c67413d

Browse files
author
staticdev
committed
#5 Added Coverage workflow
1 parent 88031b2 commit c67413d

5 files changed

Lines changed: 46 additions & 2 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Coverage
2+
on: push
3+
jobs:
4+
coverage:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: actions/setup-python@v1
9+
with:
10+
python-version: '3.8'
11+
architecture: x64
12+
- run: pip install nox==2019.11.9
13+
- run: pip install poetry==1.0.5
14+
- run: nox --sessions tests-3.8 coverage
15+
env:
16+
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# toml-validator
22

33
[![Tests](https://github.com/staticdev/toml-validator/workflows/Tests/badge.svg)](https://github.com/staticdev/toml-validator/actions?workflow=Tests)
4+
[![Codecov](https://codecov.io/gh/staticdev/toml-validator/badge.svg?branch=master&service=github)](https://codecov.io/gh/staticdev/toml-validator)
45
![PyPi](https://badge.fury.io/py/toml-validator.svg)
56
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
67

noxfile.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,11 @@ def tests(session: Session) -> None:
9090
session.run("poetry", "install", "--no-dev", external=True)
9191
install_with_constraints(session, "coverage[toml]", "pytest", "pytest-cov")
9292
session.run("pytest", *args)
93+
94+
95+
@nox.session(python="3.8")
96+
def coverage(session: Session) -> None:
97+
"""Upload coverage data."""
98+
install_with_constraints(session, "coverage[toml]", "codecov")
99+
session.run("coverage", "xml", "--fail-under=0")
100+
session.run("codecov", *session.posargs)

poetry.lock

Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@ flake8-bugbear = "^20.1.4"
2626
flake8-import-order = "^0.18.1"
2727
safety = "^1.8.5"
2828
mypy = "^0.770"
29+
codecov = "^2.0.22"
2930

3031
[tool.poetry.scripts]
3132
toml-validator = "toml_validator.console:main"
33+
3234
[tool.coverage.paths]
3335
source = ["src", "*/site-packages"] # configure source tree layout
3436

@@ -37,7 +39,8 @@ branch = true # enable branch analysis
3739
source = ["toml_validator"] # configure package name
3840

3941
[tool.coverage.report]
40-
show_missing = true # display line number of missing coverage
42+
show_missing = true
43+
fail_under = 100
4144

4245
[build-system]
4346
requires = ["poetry>=0.12"]

0 commit comments

Comments
 (0)