Skip to content

Commit dcd5d8e

Browse files
committed
Add CI workflow for tests, lint, and coverage
Runs pytest across Python 3.10-3.13 with ruff lint, uploads coverage to Codecov on main branch.
1 parent 04e9ae8 commit dcd5d8e

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Tests
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+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12", "3.13"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: pip install -e ".[dev]"
26+
27+
- name: Lint
28+
run: ruff check src/ tests/
29+
30+
- name: Run tests
31+
run: pytest tests/ -v --tb=short
32+
33+
coverage:
34+
runs-on: ubuntu-latest
35+
needs: test
36+
steps:
37+
- uses: actions/checkout@v4
38+
39+
- name: Set up Python
40+
uses: actions/setup-python@v5
41+
with:
42+
python-version: "3.12"
43+
44+
- name: Install dependencies
45+
run: pip install -e ".[dev]" pytest-cov
46+
47+
- name: Run tests with coverage
48+
run: pytest tests/ --cov=plivo_agent --cov-report=xml
49+
50+
- name: Upload coverage to Codecov
51+
uses: codecov/codecov-action@v4
52+
with:
53+
file: coverage.xml
54+
fail_ci_if_error: false
55+
env:
56+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)