Skip to content

Commit

Permalink
Merge pull request #15 from opencomputeproject/fea/codecov
Browse files Browse the repository at this point in the history
fea/add codecov.io coverage
  • Loading branch information
mimir-d authored Oct 13, 2024
2 parents 8eff4ea + fd6da33 commit 5ec4126
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 30 deletions.
18 changes: 18 additions & 0 deletions .github/codecov.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# ref: https://docs.codecov.com/docs/codecovyml-reference
coverage:
range: 100
round: down
precision: 1
status:
# ref: https://docs.codecov.com/docs/commit-status
project:
default:
# Avoid false negatives
threshold: 1%
patch:
default:
informational: true

comment:
layout: "condensed_header, files"
require_changes: true
25 changes: 0 additions & 25 deletions .github/workflows/coverage.yaml

This file was deleted.

31 changes: 26 additions & 5 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,35 @@ jobs:
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with black
run: |
black . --check --diff
run: black . --check --diff
- name: Check typing with mypy
run: |
mypy . --check-untyped-defs
run: mypy . --check-untyped-defs
- name: Test with pytest
run: pytest -v

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
pytest -v
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with black
run: black . --check --diff
- name: Check typing with mypy
run: mypy . --check-untyped-defs
- name: Get pytest coverage
run: pytest --cov-fail-under=100 --cov-report xml
- name: Upload to codecov.io
uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

spec:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 5ec4126

Please sign in to comment.