Skip to content

Commit 5ec4126

Browse files
authored
Merge pull request #15 from opencomputeproject/fea/codecov
fea/add codecov.io coverage
2 parents 8eff4ea + fd6da33 commit 5ec4126

File tree

3 files changed

+44
-30
lines changed

3 files changed

+44
-30
lines changed

.github/codecov.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# ref: https://docs.codecov.com/docs/codecovyml-reference
2+
coverage:
3+
range: 100
4+
round: down
5+
precision: 1
6+
status:
7+
# ref: https://docs.codecov.com/docs/commit-status
8+
project:
9+
default:
10+
# Avoid false negatives
11+
threshold: 1%
12+
patch:
13+
default:
14+
informational: true
15+
16+
comment:
17+
layout: "condensed_header, files"
18+
require_changes: true

.github/workflows/coverage.yaml

-25
This file was deleted.

.github/workflows/tests.yaml

+26-5
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,35 @@ jobs:
2222
python -m pip install --upgrade pip
2323
pip install -r requirements.txt
2424
- name: Lint with black
25-
run: |
26-
black . --check --diff
25+
run: black . --check --diff
2726
- name: Check typing with mypy
28-
run: |
29-
mypy . --check-untyped-defs
27+
run: mypy . --check-untyped-defs
3028
- name: Test with pytest
29+
run: pytest -v
30+
31+
coverage:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v3
35+
- name: Install python 3.11
36+
uses: actions/setup-python@v4
37+
with:
38+
python-version: 3.11
39+
- name: Install dependencies
3140
run: |
32-
pytest -v
41+
python -m pip install --upgrade pip
42+
pip install -r requirements.txt
43+
- name: Lint with black
44+
run: black . --check --diff
45+
- name: Check typing with mypy
46+
run: mypy . --check-untyped-defs
47+
- name: Get pytest coverage
48+
run: pytest --cov-fail-under=100 --cov-report xml
49+
- name: Upload to codecov.io
50+
uses: codecov/codecov-action@v4
51+
with:
52+
fail_ci_if_error: true
53+
token: ${{ secrets.CODECOV_TOKEN }}
3354

3455
spec:
3556
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)