-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (61 loc) · 1.78 KB
/
Copy pathtest-coverage.yml
File metadata and controls
71 lines (61 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Test & Coverage
on:
push:
branches:
- main
paths:
- '**/*.py'
- 'requirements.txt'
pull_request:
env:
COVERALLS_PARALLEL: true
jobs:
backend:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set PYTHONPATH
run: echo "PYTHONPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: '3.13'
cache: pip
- name: Install backend dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run backend tests with coverage
working-directory: ${{ github.workspace }}
run: |
pytest tests/backend \
--cov=backend \
--cov-report=lcov:backend/coverage/lcov.info
- name: Upload backend coverage
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: backend/coverage/lcov.info
frontend:
if: false # Disabled until frontend tests are added
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies including dev
working-directory: frontend
run: npm ci
- name: Run frontend tests with coverage
working-directory: frontend
run: npm run test:coverage
- name: Upload frontend coverage
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: frontend/coverage/lcov.info
base-path: frontend
flag-name: frontend