Skip to content

Commit eb93e91

Browse files
authored
feat: add coverage.yml (#14)
1 parent 217a652 commit eb93e91

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

.github/workflows/coverage.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Test Coverage
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v4
17+
with:
18+
python-version: '3.10'
19+
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install ".[dev]"
24+
25+
- name: Run tests with coverage
26+
run: |
27+
pytest --cov --cov-branch --cov-report=xml
28+
29+
- name: Upload coverage to Codecov
30+
uses: codecov/codecov-action@v4
31+
with:
32+
token: ${{ secrets.CODECOV_TOKEN }} # Optional if public repo

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![codecov](https://codecov.io/gh/bualust/RandomFPL/branch/main/graph/badge.svg)](https://codecov.io/gh/bualust/RandomFPL)
2+
13
# RandomFPL
24

35
A quick script to generate a pseudo-random Fantasy Premier League team.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ asyncio_mode = "strict"
2020
asyncio_default_fixture_loop_scope = "function"
2121

2222
[project.optional-dependencies]
23-
dev = ["pytest"]
23+
dev = ["pytest","pytest-cov"]

0 commit comments

Comments
 (0)