-
Notifications
You must be signed in to change notification settings - Fork 0
55 lines (46 loc) · 1.35 KB
/
Copy pathtests.yml
File metadata and controls
55 lines (46 loc) · 1.35 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
# Runs the test suites that the README's badges report on.
#
# Both jobs are deliberately hermetic: no secrets, no .env file, no network
# services. The backend suite pins its own database (SQLite), auth secrets and
# Stripe mock keys in tests/conftest.py, so a clean checkout is all it needs.
name: Tests
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
backend:
name: Backend (pytest)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# pytest.ini already enables --cov=app and enforces --cov-fail-under=60,
# so a coverage regression fails this job.
- name: Run pytest with coverage
run: python -m pytest
frontend:
name: Frontend (jest)
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
run: npm ci
- name: Run jest
run: npm run test:ci