-
Notifications
You must be signed in to change notification settings - Fork 0
258 lines (217 loc) · 7.81 KB
/
Copy pathci.yml
File metadata and controls
258 lines (217 loc) · 7.81 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_call:
# Cancel an older CI run on the same ref when a newer one is pushed.
# `release.yml` keeps cancel-in-progress: false because it must finish, but
# CI-only runs are safe (and helpful) to cancel — otherwise stale runs hold
# runner slots and an `aube ci` from a previous commit can race with the new
# install that just landed in the fresh checkout.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lint-and-format:
name: Lint and Format Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup mise
uses: jdx/mise-action@v2
with:
experimental: true
- name: Resolve aube store path
shell: bash
run: echo "AUBE_STORE=$(aube store path 2>/dev/null || echo $HOME/.local/share/aube/store)" >> "$GITHUB_ENV"
- name: Setup aube cache
uses: actions/cache@v4
with:
path: ${{ env.AUBE_STORE }}
key: ${{ runner.os }}-aube-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-aube-store-
- name: Install dependencies
run: aube ci
- name: Run Biome check
# Use `aube run check` explicitly: bare `aube check` resolves to aube's
# built-in dependency-tree verifier (`Verify that every installed package
# can resolve its declared deps...`), not our biome script.
run: aube run check
type-check:
name: TypeScript Type Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup mise
uses: jdx/mise-action@v2
with:
experimental: true
- name: Resolve aube store path
shell: bash
run: echo "AUBE_STORE=$(aube store path 2>/dev/null || echo $HOME/.local/share/aube/store)" >> "$GITHUB_ENV"
- name: Setup aube cache
uses: actions/cache@v4
with:
path: ${{ env.AUBE_STORE }}
key: ${{ runner.os }}-aube-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-aube-store-
- name: Install dependencies
run: aube ci
- name: Type check
run: aube type-check
test:
name: Unit and Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
extensions: pdo, pdo_pgsql, curl
coverage: none
- name: Setup mise
uses: jdx/mise-action@v2
with:
experimental: true
- name: Resolve aube store path
shell: bash
run: echo "AUBE_STORE=$(aube store path 2>/dev/null || echo $HOME/.local/share/aube/store)" >> "$GITHUB_ENV"
- name: Setup aube cache
uses: actions/cache@v4
with:
path: ${{ env.AUBE_STORE }}
key: ${{ runner.os }}-aube-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-aube-store-
- name: Install dependencies
run: aube ci
- name: Install PHP dependencies
run: composer install --no-interaction --prefer-dist --no-progress
working-directory: apps/sabredav
- name: Run unit and integration tests
env:
NODE_ENV: test
run: aube test
danger:
name: Danger PR Checks
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: write
statuses: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup mise
uses: jdx/mise-action@v2
with:
experimental: true
- name: Resolve aube store path
shell: bash
run: echo "AUBE_STORE=$(aube store path 2>/dev/null || echo $HOME/.local/share/aube/store)" >> "$GITHUB_ENV"
- name: Setup aube cache
uses: actions/cache@v4
with:
path: ${{ env.AUBE_STORE }}
key: ${{ runner.os }}-aube-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-aube-store-
- name: Install dependencies
run: aube ci
- name: Run Danger
run: npx danger ci
env:
DANGER_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build:
name: Build Verification
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup mise
uses: jdx/mise-action@v2
with:
experimental: true
- name: Resolve aube store path
shell: bash
run: echo "AUBE_STORE=$(aube store path 2>/dev/null || echo $HOME/.local/share/aube/store)" >> "$GITHUB_ENV"
- name: Setup aube cache
uses: actions/cache@v4
with:
path: ${{ env.AUBE_STORE }}
key: ${{ runner.os }}-aube-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-aube-store-
- name: Install dependencies
run: aube ci
- name: Build all workspaces
run: aube build
docker-smoke:
name: Docker Build Smoke Test
# PR-only: pushes to main go through the release workflow, which builds and
# publishes the real multi-arch images. This is a fast amd64 build that
# catches Dockerfile/toolchain breakage (e.g. the aube/mise install) before
# merge, then verifies native modules actually load at runtime.
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build backend image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile.backend.prod
target: backend
load: true
tags: freundebuch-backend:ci
platforms: linux/amd64
cache-from: type=gha,scope=ci-backend-prod
cache-to: type=gha,mode=max,scope=ci-backend-prod
- name: Build mcp-server image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile.backend.prod
target: mcp-server
load: true
tags: freundebuch-mcp-server:ci
platforms: linux/amd64
# Shares the builder layers with the backend build above.
cache-from: type=gha,scope=ci-backend-prod
cache-to: type=gha,mode=max,scope=ci-backend-prod
- name: Build nginx image
uses: docker/build-push-action@v6
with:
context: .
file: docker/Dockerfile.nginx.prod
load: true
tags: freundebuch-nginx:ci
platforms: linux/amd64
cache-from: type=gha,scope=ci-nginx
cache-to: type=gha,mode=max,scope=ci-nginx
- name: Smoke test images
run: |
# Resolve modules from each app's own directory: in the pnpm/aube
# workspace layout a package's deps live under apps/<name>/node_modules
# (symlinked to the virtual store), not the repo-root node_modules. This
# matches how the real CMD (node apps/<name>/dist/index.js) resolves them.
docker run --rm -w /app/apps/backend freundebuch-backend:ci node -e "require('bcrypt'); require('sharp');"
docker run --rm -w /app/apps/mcp-server freundebuch-mcp-server:ci node -e "require('bcrypt');"
# Frontend build produced static assets served by nginx.
docker run --rm freundebuch-nginx:ci test -f /app/frontend/index.html
echo "Docker smoke tests passed"