Skip to content

Commit 18de153

Browse files
committed
Add workflow for CodeCov
1 parent 09bade9 commit 18de153

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/codecov.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SPDX-FileCopyrightText: 2026 Alec Delaney
2+
# SPDX-License-Identifier: MIT
3+
4+
name: Run code tests
5+
6+
on:
7+
push:
8+
branches:
9+
- 'main'
10+
pull_request:
11+
paths:
12+
- '.github/workflows/codecov.yml'
13+
- 'pyproject.toml'
14+
- 'circuitpython_functools'
15+
- 'tests/**'
16+
17+
permissions: read-all
18+
19+
jobs:
20+
codecov:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- name: Setup Python 3.x
25+
uses: actions/setup-python@v6
26+
with:
27+
python-version: ${{ matrix.py-version }}
28+
- name: Checkout the repository
29+
uses: actions/checkout@v6
30+
- name: Install base requirements
31+
run: |
32+
pip install ".[optional]"
33+
- name: Install test requirements
34+
run: |
35+
pip install pytest pytest-cov
36+
- name: Run tests
37+
run: |
38+
pytest --cov --cov-branch --cov-report=xml
39+
- name: Upload coverage reports to Codecov
40+
uses: codecov/codecov-action@v5
41+
with:
42+
token: ${{ secrets.CODECOV_TOKEN }}
43+
fail_ci_if_error: true

0 commit comments

Comments
 (0)