Skip to content

Commit e9c039a

Browse files
authored
Create coverage.yml
1 parent 55ae2e2 commit e9c039a

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

.github/workflows/coverage.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Run Tests and Upload Coverage
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
11+
- name: Set up Python
12+
uses: actions/setup-python@v5
13+
with:
14+
python-version: "3.11"
15+
16+
- name: Install dependencies
17+
run: |
18+
pip install -r requirements.txt
19+
pip install pytest pytest-cov
20+
21+
- name: Run tests with coverage
22+
run: pytest --cov=. --cov-report=xml
23+
24+
- name: Upload coverage to Codecov
25+
uses: codecov/codecov-action@v4
26+
with:
27+
# For public repos, omit the token.
28+
# For private repos, add CODECOV_TOKEN in Settings → Secrets → Actions
29+
token: ${{ secrets.CODECOV_TOKEN }}
30+
files: ./coverage.xml

0 commit comments

Comments
 (0)