Repository navigation
92 lines (75 loc) · 3.18 KB
/
Copy pathdocs-code-ci.yml
File metadata and controls
92 lines (75 loc) · 3.18 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
name: Docs Code CI
on:
pull_request:
paths:
- ".github/actionlint.yaml"
- ".github/workflows/docs-code-ci.yml"
- ".github/workflows/docs-live-smoke.yml"
- ".github/workflows/pages.yml"
- ".github/workflows/r2-pages.yml"
- ".openclaw-sync/check-docs-mdx.mjs"
- ".openclaw-sync/lib/**"
- "Makefile"
- "package.json"
- "package-lock.json"
- "scripts/*.test.mjs"
- "scripts/docs-site/**"
- "workers/**"
- "wrangler.toml"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: docs-code-ci-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
validate:
name: Validate docs code
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Node
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 26.12.1
cache: npm
- name: Install
run: npm ci
- name: Install Playwright browser
run: npx playwright install --with-deps chromium webkit
- name: Syntax check scripts
run: |
find scripts .openclaw-sync -name '*.mjs' -print0 \
| xargs -0 -n 1 node --check
- name: Test docs helpers
run: npm test
- name: Validate Worker bundle
run: npx wrangler@4.131.1 deploy --dry-run --config wrangler.toml
- name: Restore rendered articles
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .cache/docs-render
key: docs-articles-v1-${{ runner.os }}-${{ hashFiles('scripts/docs-site/render-cache.mjs', 'scripts/docs-site/mdx-ish.mjs', '.openclaw-sync/lib/docs-markdown.mjs', 'package-lock.json') }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
docs-articles-v1-${{ runner.os }}-${{ hashFiles('scripts/docs-site/render-cache.mjs', 'scripts/docs-site/mdx-ish.mjs', '.openclaw-sync/lib/docs-markdown.mjs', 'package-lock.json') }}-
- name: Restore preview images
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: .cache/docs-og
key: docs-og-v1-${{ runner.os }}-${{ hashFiles('scripts/docs-site/og-cache.mjs', 'scripts/docs-site/og-render-worker.mjs', 'scripts/docs-site/fonts/**', 'package-lock.json') }}-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: |
docs-og-v1-${{ runner.os }}-${{ hashFiles('scripts/docs-site/og-cache.mjs', 'scripts/docs-site/og-render-worker.mjs', 'scripts/docs-site/fonts/**', 'package-lock.json') }}-
- name: Build shell artifact
env:
DOCS_SITE_GA4_ENABLED: "1"
run: npm run docs:build:r2:shell
- name: Smoke shell artifact
run: npm run docs:smoke:shell
- name: Visual smoke
run: npm run docs:visual
- name: Mermaid in WebKit
run: npm run docs:visual -- --mermaid-only --webkit
- name: Community invitation in Chromium and WebKit
run: npm run docs:visual:community