Skip to content

Commit 62eb212

Browse files
committed
.github: add Tests workflow
1 parent 5f77512 commit 62eb212

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

.github/workflows/tests.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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-24.04
12+
13+
env:
14+
PYTHONPATH: ${{ github.workspace }}:${{ github.workspace }}/web
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: '3.10'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install pytest
29+
pip install -r tests/requirements.txt
30+
pip install -r web/requirements.txt
31+
32+
- name: Run tests
33+
run: |
34+
pytest tests/ -v --tb=short
35+
36+
- name: Run tests with coverage
37+
run: |
38+
pytest tests/ --cov=. --cov-report=term --cov-report=xml
39+
40+
- name: Upload coverage reports
41+
uses: codecov/codecov-action@v4
42+
if: success()
43+
with:
44+
file: ./coverage.xml
45+
fail_ci_if_error: false

0 commit comments

Comments
 (0)