-
Notifications
You must be signed in to change notification settings - Fork 0
385 lines (328 loc) · 10.5 KB
/
Copy pathci.yml
File metadata and controls
385 lines (328 loc) · 10.5 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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
name: CI
on:
push:
branches:
- dev
paths:
- "apps/backend/**"
- "packages/drf-std-response/**"
- "docs/contributors/**"
- "docs/alienmark/**"
- "docs/users/**"
- "apps/alienmark/**"
- "apps/frontend/**"
- "packages/alienmark/**"
- "LICENSE"
- "COPYING.md"
- "branding/LICENSE"
- ".github/assets/**"
- "scripts/check-licenses.mjs"
- "package.json"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "knip.jsonc"
- "turbo.json"
- "vite.config.ts"
- "make/node.mk"
- "make/docker.mk"
- "infra/**"
- "env/.env.proxy.example"
- "pyproject.toml"
- "uv.lock"
- ".github/workflows/ci.yml"
pull_request:
branches:
- dev
paths:
- "apps/backend/**"
- "packages/drf-std-response/**"
- "docs/contributors/**"
- "docs/alienmark/**"
- "docs/users/**"
- "apps/alienmark/**"
- "apps/frontend/**"
- "packages/alienmark/**"
- "LICENSE"
- "COPYING.md"
- "branding/LICENSE"
- ".github/assets/**"
- "scripts/check-licenses.mjs"
- "package.json"
- "pnpm-lock.yaml"
- "pnpm-workspace.yaml"
- "knip.jsonc"
- "turbo.json"
- "vite.config.ts"
- "make/node.mk"
- "make/docker.mk"
- "infra/**"
- "env/.env.proxy.example"
- "pyproject.toml"
- "uv.lock"
- ".github/workflows/ci.yml"
permissions:
contents: read
jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
backend: ${{ steps.filter.outputs.backend }}
docs-contributors: ${{ steps.filter.outputs.docs-contributors }}
docs-alienmark: ${{ steps.filter.outputs.docs-alienmark }}
docs-users: ${{ steps.filter.outputs.docs-users }}
node: ${{ steps.filter.outputs.node }}
infra: ${{ steps.filter.outputs.infra }}
workflow: ${{ steps.filter.outputs.workflow }}
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Detect changed CI areas
id: filter
uses: dorny/paths-filter@v4
with:
filters: |
backend:
- 'apps/backend/**'
- 'packages/drf-std-response/**'
- 'pyproject.toml'
- 'uv.lock'
docs-contributors:
- 'docs/contributors/**'
- 'pyproject.toml'
- 'uv.lock'
docs-alienmark:
- 'docs/alienmark/**'
- 'pyproject.toml'
- 'uv.lock'
docs-users:
- 'docs/users/**'
- 'pyproject.toml'
- 'uv.lock'
node:
- 'apps/alienmark/**'
- 'apps/frontend/**'
- 'packages/alienmark/**'
- 'LICENSE'
- 'COPYING.md'
- 'branding/LICENSE'
- '.github/assets/**'
- 'scripts/check-licenses.mjs'
- 'package.json'
- 'pnpm-lock.yaml'
- 'pnpm-workspace.yaml'
- 'knip.jsonc'
- 'turbo.json'
- 'vite.config.ts'
- 'make/node.mk'
infra:
- 'infra/**'
- 'make/docker.mk'
- 'env/.env.proxy.example'
workflow:
- '.github/workflows/ci.yml'
backend-lint:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.workflow == 'true'
defaults:
run:
working-directory: apps/backend
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.11.23"
enable-cache: true
working-directory: .
cache-suffix: backend-lint
- name: Install lint dependencies
run: uv sync --project ../.. --locked --dev --package aliencommons-backend
- name: Run Ruff
run: >
uv run --project ../.. --package aliencommons-backend ruff check
articles
bookmarks
comments
backend
core
logs
notifications
posts
reactions
reports
tasks
users
manage.py
backend-tests:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.backend == 'true' || needs.changes.outputs.workflow == 'true'
defaults:
run:
working-directory: apps/backend
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.11.23"
enable-cache: true
working-directory: .
cache-suffix: backend-tests
- name: Install backend dependencies
run: uv sync --project ../.. --locked --dev --package aliencommons-backend
- name: Run Backend tests
env:
DJANGO_SETTINGS_MODULE: backend.settings.test
run: uv run --project ../.. --package aliencommons-backend python manage.py test
node:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.node == 'true' || needs.changes.outputs.workflow == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up pnpm
uses: pnpm/action-setup@v6
with:
run_install: false
- name: Set up Node.js
uses: actions/setup-node@v7
with:
node-version: "24"
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Enable Corepack
run: corepack enable
- name: Install workspace dependencies
run: pnpm install --frozen-lockfile
- name: Run Node checks
run: pnpm run check
- name: Audit repository licenses
run: pnpm run license:check
infra:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.infra == 'true' || needs.changes.outputs.workflow == 'true'
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Prepare non-secret Compose validation environments
run: |
cp env/.env.dev env/.env.stg
cp env/.env.dev env/.env.pro
- name: Validate proxy Compose configuration
env:
TRAEFIK_ACME_EMAIL: ci@aliencommons.invalid
run: docker compose -f infra/compose/docker-compose.proxy.yml config --quiet
- name: Validate staging Compose configuration
env:
GRAFANA_ADMIN_PASSWORD: ci-only
run: >-
docker compose --env-file env/.env.stg
-f infra/compose/docker-compose.base.yml
-f infra/compose/docker-compose.stg.yml
config --quiet
- name: Validate production Compose configuration
env:
GRAFANA_ADMIN_PASSWORD: ci-only
run: >-
docker compose --env-file env/.env.pro
-f infra/compose/docker-compose.base.yml
-f infra/compose/docker-compose.pro.yml
config --quiet
docs-contributors:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.docs-contributors == 'true' || needs.changes.outputs.workflow == 'true'
defaults:
run:
working-directory: docs/contributors
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.11.23"
enable-cache: true
working-directory: .
cache-suffix: docs-validate-contributors
- name: Install documentation dependencies
run: uv sync --project ../.. --locked --package aliencommons-contributor-docs
- name: Build and validate English Zensical site
run: uv run --project ../.. --package aliencommons-contributor-docs zensical build --strict
- name: Build and validate Chinese Zensical site
run: uv run --project ../.. --package aliencommons-contributor-docs zensical build --strict --config-file zensical.zh.toml
docs-alienmark:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.docs-alienmark == 'true' || needs.changes.outputs.workflow == 'true'
defaults:
run:
working-directory: docs/alienmark
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.11.23"
enable-cache: true
working-directory: .
cache-suffix: docs-validate-alienmark
- name: Install documentation dependencies
run: uv sync --project ../.. --locked --package alienmark-docs
- name: Build and validate English Zensical site
run: uv run --project ../.. --package alienmark-docs zensical build --strict
- name: Build and validate Chinese Zensical site
run: uv run --project ../.. --package alienmark-docs zensical build --strict --config-file zensical.zh.toml
docs-users:
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.docs-users == 'true' || needs.changes.outputs.workflow == 'true'
defaults:
run:
working-directory: docs/users
steps:
- name: Checkout repository
uses: actions/checkout@v7
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: "3.14"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
version: "0.11.23"
enable-cache: true
working-directory: .
cache-suffix: docs-validate-users
- name: Install documentation dependencies
run: uv sync --project ../.. --locked --package aliencommons-user-guide
- name: Build and validate English Zensical site
run: uv run --project ../.. --package aliencommons-user-guide zensical build --strict
- name: Build and validate Chinese Zensical site
run: uv run --project ../.. --package aliencommons-user-guide zensical build --strict --config-file zensical.zh.toml