-
Notifications
You must be signed in to change notification settings - Fork 0
246 lines (228 loc) · 7.56 KB
/
sop-gate.yml
File metadata and controls
246 lines (228 loc) · 7.56 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
# SOP Gate — v0.21.x Hardening CI
#
# Runs the full 11-gate SOP pipeline defined in docs/sop/v0.21.x/README.md.
# Triggered on push to dev/main and on PRs. Also available via workflow_dispatch.
#
# If any gate fails, v0.22.0 Edge Full-Stack should NOT start.
name: SOP Gate (v0.21.x)
on:
push:
branches: [main, dev]
pull_request:
branches: [main, dev]
workflow_dispatch:
jobs:
# ─── Gate 1 ───
fmt-check:
name: 'fmt:check'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- run: deno task fmt:check
# ─── Gate 2 ───
lint:
name: 'lint'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- run: deno task lint
# ─── Gate 3 ───
typecheck:
name: 'typecheck'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- run: deno install --node-modules-dir
- run: deno task typecheck
# ─── Gate 4 ───
audit:
name: 'audit'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- run: deno audit
# ─── Gate 5 — Full test suite (includes SSG starter proof) ───
test:
name: 'test (incl. SSG starter proof)'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- run: deno install --node-modules-dir
- name: Run full test suite
run: deno task test
# ─── Gate 5b — SSG starter proof (isolated) ───
# SOP-010 Q4: Does the SSG blog/docs path build from a generated project?
# This runs ONLY the create package test that scaffolds + builds end-to-end.
test-ssg-starter:
name: 'SSG starter proof (SOP-010 Q4)'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- run: deno install --node-modules-dir
- name: Run SSG starter proof test
run: deno test packages/create/__tests__/cli.test.ts --allow-read --allow-write --allow-env --allow-run --allow-ffi --filter "generated project builds"
# ─── Gate 6 — Build ───
build:
name: 'build'
runs-on: ubuntu-latest
needs: [lint]
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- run: deno install --node-modules-dir
- run: deno task build
# ─── Gate 7 — DSD conformance report ───
dsd-check:
name: 'dsd:check-report'
runs-on: ubuntu-latest
needs: [lint]
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- run: deno install --node-modules-dir
- name: Build www site (produces dsd-report.json)
run: deno task build
- run: deno task dsd:check-report
# ─── Gate 8 — Hub validation ───
hub-validate:
name: 'hub:validate'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- run: deno install --node-modules-dir
- run: deno task hub:validate -- --strict --json
# ─── Gate 9 — Hub index check ───
hub-check-index:
name: 'hub:check-index'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- run: deno task hub:check-index
# ─── Gate 10 — Strategic docs check ───
docs-check:
name: 'docs:check-strategy'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- run: deno task docs:check-strategy
# ─── Gate 11b — JSR consumer ESM graph build (SOP-011: real JSR, no patching) ───
test-create-jsr:
name: 'JSR consumer build (${{ matrix.os }})'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- name: Create project from JSR
# Track the current JSR release because this gate proves the documented
# user command, not a historical pinned package.
working-directory: ${{ runner.temp }}
run: deno run -A jsr:@lessjs/create test-blog
- name: Build generated project
working-directory: ${{ runner.temp }}/test-blog
run: deno task build
- name: Verify build output
shell: bash
run: test -f "${RUNNER_TEMP}/test-blog/dist/index.html" && grep -q '<html' "${RUNNER_TEMP}/test-blog/dist/index.html"
# ─── Gate 11 — E2E tests ───
test-e2e:
name: 'test:e2e'
runs-on: ubuntu-latest
needs: [lint]
steps:
- uses: actions/checkout@v4
- uses: denoland/setup-deno@v2
with:
deno-version: '2'
- run: deno install --node-modules-dir
- name: Build www site (needed for Playwright webServer)
run: deno task build
- name: Install Playwright Chromium
run: npx -y playwright@1.59.1 install chromium --with-deps
- name: Run E2E tests
run: deno task test:e2e
# ─── Gate Summary ───
gate-summary:
name: 'SOP Gate Summary'
runs-on: ubuntu-latest
needs:
[
fmt-check,
lint,
typecheck,
audit,
test,
test-ssg-starter,
build,
dsd-check,
hub-validate,
hub-check-index,
docs-check,
test-create-jsr,
test-e2e,
]
if: always()
steps:
- name: Check all gates
run: |
ALL_PASS=true
check() { if [ "$1" = "success" ]; then echo "- [x] $2"; else echo "- [ ] $2 (failed)"; ALL_PASS=false; fi; }
{
echo "## SOP Gate v0.21.x Results"
echo ""
check "${{ needs.fmt-check.result }}" "fmt:check"
check "${{ needs.lint.result }}" "lint"
check "${{ needs.typecheck.result }}" "typecheck"
check "${{ needs.audit.result }}" "audit"
check "${{ needs.test.result }}" "test (incl. SSG starter proof)"
check "${{ needs.test-ssg-starter.result }}" "SSG starter proof (SOP-010 Q4)"
check "${{ needs.build.result }}" "build"
check "${{ needs.dsd-check.result }}" "dsd:check-report"
check "${{ needs.hub-validate.result }}" "hub:validate --strict"
check "${{ needs.hub-check-index.result }}" "hub:check-index"
check "${{ needs.docs-check.result }}" "docs:check-strategy"
check "${{ needs.test-create-jsr.result }}" "JSR consumer build (ubuntu + windows)"
check "${{ needs.test-e2e.result }}" "test:e2e"
echo ""
if [ "$ALL_PASS" = "true" ]; then
echo "🎉 **All 13 SOP gates passed. v0.22.0 Edge Full-Stack may proceed.**"
else
echo "⚠️ **Some gates failed. v0.22.0 must not start until all gates pass.**"
exit 1
fi
} >> "$GITHUB_STEP_SUMMARY"