-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (106 loc) · 3.33 KB
/
Copy pathtest.yml
File metadata and controls
125 lines (106 loc) · 3.33 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: Tests
on:
push:
branches: [main, staging]
pull_request:
branches: [main, staging]
concurrency:
group: tests-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
frontend:
name: Frontend (vitest)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Cache Bun install
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run tests with coverage
working-directory: apps/web
run: bun run test:coverage
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: frontend-coverage
path: apps/web/coverage
retention-days: 14
convex:
name: Convex (vitest)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Cache Bun install
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Run tests with coverage
working-directory: packages/convex-backend
run: bun run test:coverage
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: convex-coverage
path: packages/convex-backend/coverage
retention-days: 14
fastapi:
name: FastAPI (pytest)
runs-on: ubuntu-latest
# Redis service for the live-stream fan-out integration tests
# (test_stream_bus_integration). They skip when REDIS_URL_TEST is
# unreachable, so locals without Redis aren't blocked — CI always has it.
services:
redis:
# Match the prod box's redis6.2 (op set is stable, but test what we ship).
image: redis:6.2-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 3s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.13"
cache: pip
cache-dependency-path: packages/fastapi/requirements-dev.txt
- name: Install dependencies
working-directory: packages/fastapi
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run tests with coverage
working-directory: packages/fastapi
env:
REDIS_URL_TEST: redis://localhost:6379/15
run: pytest --cov --cov-report=term --cov-report=xml --cov-report=html
- name: Upload coverage artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: fastapi-coverage
path: |
packages/fastapi/htmlcov
packages/fastapi/coverage.xml
retention-days: 14