Repository navigation
171 lines (146 loc) · 4.29 KB
/
Copy pathci.yml
File metadata and controls
171 lines (146 loc) · 4.29 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
backend-tests:
name: Backend tests
runs-on: ubuntu-latest
timeout-minutes: 15
defaults:
run:
working-directory: backend
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Java 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
cache: gradle
- name: Run backend tests
run: ./gradlew test --no-daemon
frontend-typecheck:
name: Frontend typecheck
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: frontend
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Node.js 24
uses: actions/setup-node@v6
with:
node-version: "24"
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install frontend dependencies
run: npm ci
- name: Run TypeScript typecheck
run: npm run typecheck
- name: Test resumable log streaming
run: npm test
worker-tests:
name: Worker tests
runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
working-directory: worker
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Python 3.13
uses: actions/setup-python@v6
with:
python-version: "3.13"
cache: pip
cache-dependency-path: worker/pyproject.toml
- name: Install Worker test dependencies
run: python -m pip install --editable ".[test]"
- name: Run Worker tests
run: python -m pytest
docker-build:
name: Docker build
runs-on: ubuntu-latest
timeout-minutes: 20
needs:
- backend-tests
- frontend-typecheck
- worker-tests
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Validate Compose configuration
run: docker compose config --quiet
- name: Test production deployment configuration
run: python3 -m unittest discover -s tests/deployment -v
- name: Build service images
run: docker compose build
- name: Validate production proxies
run: |
docker run --rm --network none --add-host backend:127.0.0.1 \
-v "$PWD/frontend/nginx.prod.conf:/etc/nginx/conf.d/default.conf:ro" \
labflow-frontend:local nginx -t
docker run --rm --network none \
-e LABFLOW_DOMAIN=labflow.example.org -e ACME_EMAIL=owner@example.org \
-v "$PWD/infra/Caddyfile:/etc/caddy/Caddyfile:ro" \
caddy:2-alpine caddy validate --config /etc/caddy/Caddyfile --adapter caddyfile
week4-e2e:
name: Week 4 scientific job acceptance
runs-on: ubuntu-latest
timeout-minutes: 20
needs:
- backend-tests
- frontend-typecheck
- worker-tests
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Node.js 24
uses: actions/setup-node@v6
with:
node-version: "24"
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Install browser test dependencies
working-directory: frontend
run: |
npm ci
npx playwright install --with-deps chromium
- name: Start the real stack
run: docker compose up --build --wait --wait-timeout 180
- name: Run H2 acceptance test
working-directory: frontend
run: npm run test:e2e
- name: Upload acceptance evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: week4-acceptance
path: frontend/test-results/
if-no-files-found: ignore
- name: Stop the test stack
if: always()
run: docker compose down