-
Notifications
You must be signed in to change notification settings - Fork 0
132 lines (105 loc) · 2.96 KB
/
Copy pathci.yml
File metadata and controls
132 lines (105 loc) · 2.96 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
name: CI
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
k8s:
name: K8s manifests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: azure/setup-kubectl@v4
with:
version: v1.30.0
- name: Validate kustomize renders
run: make k8s-validate
backend:
name: Backend (Python 3.12)
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16
env:
POSTGRES_DB: openhive_test
POSTGRES_USER: openhive
POSTGRES_PASSWORD: openhive
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U openhive"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install uv
uses: astral-sh/setup-uv@v4
with:
version: "latest"
- name: Install dependencies
working-directory: server
run: uv sync --all-extras
- name: Lint (ruff)
working-directory: server
run: uv run ruff check hive/ tests/
- name: Type check (pyright)
working-directory: server
run: uv run pyright hive/
continue-on-error: true # remove once pyright strict is fully clean
- name: Test (pytest)
working-directory: server
env:
DATABASE_URL: postgresql+asyncpg://openhive:openhive@localhost:5432/openhive_test
LLM_API_KEY: test-key
run: uv run pytest tests/ -q --tb=short -m "not integration"
frontend:
name: Frontend (Node 20)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: web/package-lock.json
- name: Install dependencies
working-directory: web
run: npm ci
- name: Type check (tsc)
working-directory: web
run: npx tsc --noEmit
- name: Test (vitest)
working-directory: web
run: npm test
e2e:
name: E2E (Playwright)
runs-on: ubuntu-latest
needs: frontend
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: web/package-lock.json
- name: Install dependencies
working-directory: web
run: npm ci
- name: Install Playwright browsers
working-directory: web
run: npx playwright install --with-deps chromium
- name: Run E2E tests
working-directory: web
run: npx playwright test
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: web/playwright-report/
retention-days: 7