Skip to content

Create codecov.yml

Create codecov.yml #1

Workflow file for this run

---
name: Codecov Coverage Report
on: # yamllint disable-line rule:truthy
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
run:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.12"]
steps:
- uses: actions/checkout@main
- name: Setup Python
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
- name: Install prerequisites
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
- name: Install pytest, pytest-cov
run: |
pip install pytest
pip install pytest-cov
- name: Generate coverage report
# yamllint disable rule:line-length
run: |
python -c "import os; print(os.getcwd())"
python -m pytest tests/ -v --cov-report term-missing --cov=lessons --cov-report=xml
# yamllint enable rule:line-length
- name: Upload coverage to Codecov
uses: codecov/[email protected]
with:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
fail_ci_if_error: true # optional (default = false)
verbose: true # optional (default = false)cd