-
Notifications
You must be signed in to change notification settings - Fork 0
388 lines (314 loc) · 12.6 KB
/
Copy pathci.yml
File metadata and controls
388 lines (314 loc) · 12.6 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
386
387
388
name: CI
on:
push:
branches:
- main
pull_request:
types:
- opened
- edited
- reopened
- synchronize
- ready_for_review
workflow_dispatch:
permissions:
contents: read
jobs:
pr-title:
name: PR title
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Check Conventional Commit title
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: scripts/check-pr-title.sh "$PR_TITLE"
supply-chain-pins:
name: Supply-chain pins
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Check pinned workflow and publish tooling inputs
run: scripts/check-supply-chain-pins.sh
go-tests:
name: Go tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-14
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26.4'
cache: true
- name: Run Go module tests
run: |
go version
go env GOVERSION
scripts/check-root-deps.sh
scripts/test-go-modules.sh
vulnerabilities:
name: Reachable vulnerabilities
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26.4'
cache: true
- name: Check reachable Go vulnerabilities
run: scripts/vulncheck-go-modules.sh
runtime-race:
name: Runtime race detector
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26.4'
cache: true
- name: Run focused runtime race tests
run: scripts/test-runtime-race.sh
cli-build:
name: CLI build
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26.4'
cache: true
- name: Build CLI
run: go build ./cmd/gowdk
dead-code:
name: Dead code
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26.4'
cache: true
- name: Check focused dead code
run: scripts/check-dead-code.sh
vscode-extension:
name: VS Code extension
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: '24'
- name: Check VS Code extension syntax
run: |
node editors/vscode/scripts/sync-version.js --check
node --check editors/vscode/extension.js
node --check editors/vscode/extension-core.js
- name: Run VS Code extension unit tests
run: node --test editors/vscode/*.test.js
docs:
name: Documentation links
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26.4'
cache: true
- name: Check documentation links
run: sh scripts/check-docs-links.sh
- name: Check documentation style
run: sh scripts/check-docs-style.sh
- name: Check for removed source syntax in docs
run: sh scripts/check-removed-syntax.sh
- name: Check docs do not pin a release version
run: sh scripts/check-doc-versions.sh
docs-site:
name: Docs site compile
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26.4'
cache: true
- name: Build and smoke docs site against in-tree GOWDK
working-directory: docs-site
run: |
set -euxo pipefail
scripts/install-tailwind-linux.sh
scripts/build-production.sh
scripts/smoke-production.sh
go test ./...
go vet ./...
example-reports:
name: Example reports
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26.4'
cache: true
- name: Check example reports
run: sh scripts/check-example-reports.sh
parser-fuzz:
name: Parser fuzz smoke
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26.4'
cache: true
- name: Run parser fuzz smoke
env:
GOWDK_FUZZTIME: 1000x
run: scripts/test-parser-fuzz.sh
generated-app-integration:
name: Generated app integration
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26.4'
cache: true
- name: Run generated app integration tests
run: scripts/test-generated-app-integration.sh
generated-output-determinism:
name: Generated output determinism
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26.4'
cache: true
- name: Check generated output determinism
run: scripts/test-generated-output-determinism.sh
generated-output:
name: Generated output smoke
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Set up Go
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6
with:
go-version: '1.26.4'
cache: true
- name: Smoke build SPA example output
run: |
rm -rf /tmp/gowdk-build
go run ./cmd/gowdk build --out /tmp/gowdk-build examples/pages/home.page.gwdk examples/pages/hero.cmp.gwdk
test -f /tmp/gowdk-build/gowdk-routes.json
test -f /tmp/gowdk-build/gowdk-assets.json
- name: Smoke build dynamic SPA output
run: |
rm -rf /tmp/gowdk-dynamic-build
go run ./cmd/gowdk build --out /tmp/gowdk-dynamic-build examples/pages/blog-post.page.gwdk
test -f /tmp/gowdk-dynamic-build/blog/hello-gowdk/index.html
test -f /tmp/gowdk-dynamic-build/blog/compile-first/index.html
- name: Build login backend example
run: |
set -euxo pipefail
cd examples/login
rm -rf .gowdk bin dist
go run ../../cmd/gowdk build
output=".gowdk/output/login"
test -f "$output/index.html"
test -f "$output/dashboard/index.html"
test -x bin/login
test -x bin/login-frontend
test -x bin/login-backend
login_css="$(sed -nE 's/.*"login.css": "([^"]+)".*/\1/p' "$output/gowdk-assets.json" | head -n1)"
echo "login.css resolves to ${login_css}"
test -n "$login_css"
test -f "$output/$login_css"
go test ./src/features/auth
- name: Smoke build CSS example output
run: |
rm -rf /tmp/gowdk-css-build
go run ./cmd/gowdk build --config examples/css/gowdk.config.go --out /tmp/gowdk-css-build examples/css/styled.page.gwdk
grep -F '<link rel="stylesheet" href="/assets/site.css">' /tmp/gowdk-css-build/styled/index.html
- name: Smoke build SEO addon output
run: |
rm -rf /tmp/gowdk-seo-build
go run ./cmd/gowdk build --config examples/seo/gowdk.config.go --out /tmp/gowdk-seo-build examples/seo/*.gwdk
test -f /tmp/gowdk-seo-build/sitemap.xml
test -f /tmp/gowdk-seo-build/robots.txt
grep -F 'https://example.com/seo/blog/hello-gowdk' /tmp/gowdk-seo-build/sitemap.xml
grep -F 'Sitemap: https://example.com/sitemap.xml' /tmp/gowdk-seo-build/robots.txt
- name: Smoke build embedded binary example
run: |
rm -rf /tmp/gowdk-embed-build /tmp/gowdk-embed-app /tmp/gowdk-embed-site
go run ./cmd/gowdk build --out /tmp/gowdk-embed-build --app /tmp/gowdk-embed-app --bin /tmp/gowdk-embed-site examples/embed/site.page.gwdk
test -x /tmp/gowdk-embed-site
GOWDK_SMOKE_ADDR=127.0.0.1:18085 scripts/smoke-generated-binary.sh /tmp/gowdk-embed-site /embed "Embedded GOWDK"
- name: Smoke build generated WASM artifact
run: |
rm -rf /tmp/gowdk-wasm-build /tmp/gowdk-wasm-app /tmp/gowdk-site.wasm
go run ./cmd/gowdk build --out /tmp/gowdk-wasm-build --app /tmp/gowdk-wasm-app --wasm /tmp/gowdk-site.wasm examples/embed/site.page.gwdk
scripts/smoke-generated-wasm.sh /tmp/gowdk-site.wasm
- name: Smoke build hybrid example output
run: |
rm -rf /tmp/gowdk-hybrid-build /tmp/gowdk-hybrid-app /tmp/gowdk-hybrid-site
go run ./cmd/gowdk build --ssr --out /tmp/gowdk-hybrid-build --app /tmp/gowdk-hybrid-app --bin /tmp/gowdk-hybrid-site examples/ssr/hybrid-static.page.gwdk
test -x /tmp/gowdk-hybrid-site
go run ./cmd/gowdk routes --ssr examples/ssr/hybrid-static.page.gwdk > /tmp/gowdk-hybrid-routes.json
grep -F '"kind": "ssr"' /tmp/gowdk-hybrid-routes.json
grep -F '"pageId": "hybrid.static"' /tmp/gowdk-hybrid-routes.json
grep -F '"code": "spa_disabled"' /tmp/gowdk-hybrid-routes.json
- name: Smoke build component asset output
run: |
rm -rf /tmp/gowdk-component-assets
go run ./cmd/gowdk build --out /tmp/gowdk-component-assets examples/components/assets/*.gwdk
test -f /tmp/gowdk-component-assets/components/assets/index.html
grep -F '"assets/gowdk/components/componentassets/AssetBadge/badge.svg"' /tmp/gowdk-component-assets/gowdk-assets.json
grep -F 'assets/gowdk/components/componentassets/AssetBadge/badge.' /tmp/gowdk-component-assets/gowdk-assets.json
- name: Smoke build WASM island example output
run: |
rm -rf /tmp/gowdk-wasm-island
go run ./cmd/gowdk build --out /tmp/gowdk-wasm-island examples/components/wasm/*.gwdk
test -f /tmp/gowdk-wasm-island/components/wasm/index.html
test -f /tmp/gowdk-wasm-island/assets/gowdk/islands/componentwasm/WasmCounter.wasm
test -f /tmp/gowdk-wasm-island/assets/gowdk/islands/componentwasm/WasmCounter.wasm.js
test -f /tmp/gowdk-wasm-island/assets/gowdk/islands/wasm_exec.js
- name: Smoke build persisted store example output
run: |
rm -rf /tmp/gowdk-store-persist
go run ./cmd/gowdk build --out /tmp/gowdk-store-persist examples/store-persist/*.gwdk
test -f /tmp/gowdk-store-persist/shop/index.html
grep -F 'data-gowdk-persist="local"' /tmp/gowdk-store-persist/shop/index.html