-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (112 loc) · 3.55 KB
/
ci.yml
File metadata and controls
137 lines (112 loc) · 3.55 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
126
127
128
129
130
131
132
133
134
135
136
137
name: CI
on:
push:
branches: [master, main]
pull_request:
branches: [master, main]
jobs:
frontend:
name: Frontend (TypeScript + Lint + Test + Build)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install dependencies
working-directory: frontend
run: npm ci
- name: TypeScript type check
working-directory: frontend
run: npx tsc --noEmit
- name: ESLint
working-directory: frontend
run: npx eslint src/ --quiet
- name: Vitest (358 unit tests)
working-directory: frontend
run: npx vitest run
- name: Vite production build
working-directory: frontend
run: npm run build
e2e:
name: E2E (Playwright)
runs-on: ubuntu-latest
needs: [frontend, backend]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: backend/requirements.txt
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install backend dependencies
working-directory: backend
run: pip install -r requirements.txt
- name: Install frontend dependencies
working-directory: frontend
run: npm ci
- name: Install Playwright browsers
working-directory: frontend
run: npx playwright install --with-deps chromium
- name: Start backend
working-directory: backend
run: |
python -m uvicorn main:app --port 8008 &
sleep 5
curl -sf http://localhost:8008/ || exit 1
curl -s -X POST http://localhost:8008/api/auth/register \
-H "Content-Type: application/json" \
-d '{"username":"admin","password":"test1234","display_name":"Admin"}'
- name: Start frontend dev server
working-directory: frontend
run: npm run dev &
env:
VITE_API_URL: http://localhost:8008
- name: Wait for frontend
run: |
for i in $(seq 1 30); do
curl -sf http://localhost:5173/ > /dev/null 2>&1 && exit 0
sleep 2
done
exit 1
- name: Run E2E tests (capture tests excluded)
working-directory: frontend
env:
VITE_API_URL: http://localhost:8008
TEST_ADMIN_PASSWORD: test1234
run: >-
npx playwright test
e2e/admin.spec.ts
e2e/auth.spec.ts
e2e/project.spec.ts
e2e/regression-full.spec.ts
e2e/tc-management.spec.ts
e2e/v060-features.spec.ts
--reporter=list
timeout-minutes: 15
backend:
name: Backend (pytest 116 tests)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
cache-dependency-path: backend/requirements.txt
- name: Install dependencies
working-directory: backend
run: pip install -r requirements.txt pytest requests
- name: pytest (116 tests)
working-directory: backend
env:
TEST_ADMIN_PASSWORD: test1234
run: python -m pytest test_security.py -q --tb=short -k "not test_dompurify_installed"
timeout-minutes: 20