Repository navigation
377 lines (317 loc) · 12.3 KB
/
Copy pathsnippets.yml
File metadata and controls
377 lines (317 loc) · 12.3 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
name: Snippet checks
on:
pull_request:
push:
branches:
- develop
- main
jobs:
extract-sdk-version:
name: Extract SDK version
runs-on: ubuntu-latest
outputs:
sdk-version: ${{ steps.version.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
- name: Extract SDK version from package.json
id: version
run: |
VERSION=$(node -p "require('./package.json').dependencies['@wraith-protocol/sdk']")
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Detected SDK version: $VERSION"
check-snippets:
name: Compile docs snippets
runs-on: ubuntu-latest
needs: extract-sdk-version
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Download published SDK artifact
run: |
echo "Downloading @wraith-protocol/sdk@${{ needs.extract-sdk-version.outputs.sdk-version }}"
cd /tmp
npm pack @wraith-protocol/sdk@${{ needs.extract-sdk-version.outputs.sdk-version }}
- name: Install dependencies with pinned SDK
run: |
pnpm install --frozen-lockfile
pnpm remove @wraith-protocol/sdk
pnpm add /tmp/wraith-protocol-sdk-${{ needs.extract-sdk-version.outputs.sdk-version }}.tgz
- name: Record tested SDK version
run: |
echo "Testing against SDK version: ${{ needs.extract-sdk-version.outputs.sdk-version }}"
- name: Check snippets
run: pnpm run check:snippets
- name: Check integration guides
run: pnpm run check:integration-guides
- name: Check placeholders
run: pnpm run check:placeholders
- name: Check nav coverage
run: pnpm run check:nav-coverage
- name: Check contract registry
run: pnpm run check:contract-registry
- name: Check compatibility matrix
run: pnpm run check:compatibility-matrix
- name: Check redirects and anchors
env:
DOCS_DIFF_BASE: ${{ github.event.pull_request.base.sha || github.event.before }}
DOCS_DIFF_HEAD: ${{ github.event.pull_request.head.sha || github.sha }}
run: pnpm run check:redirects-and-anchors
- name: Test redirects and anchors check
run: pnpm run test:redirects-and-anchors
- name: Test compatibility matrix (regression fixtures)
run: pnpm run test:compatibility-matrix
check-snippets-extended:
name: Compile Rust / Python / shell / config snippets
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
# -----------------------------------------------------------------------
# Rust — pinned stable toolchain for reproducibility.
# -----------------------------------------------------------------------
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: "1.78.0"
# -----------------------------------------------------------------------
# Python — pinned minor version; patch resolved by setup-python.
# -----------------------------------------------------------------------
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
# bash is already present on ubuntu-latest; print versions for the log.
- name: Verify toolchains
run: |
rustc --version
python3 --version
bash --version | head -1
- name: Check extended snippets (Rust / Python / shell / JSON / TOML / YAML)
run: pnpm run check:snippets-extended
# ---------------------------------------------------------------------------
# Stellar testnet snippet validation — split into two steps so that
# deterministic content regressions block merges while provider outages
# are surfaced as annotations without blocking.
#
# Exit codes from check-stellar-testnet-snippets.ts:
# 0 – passed
# 1 – content regression → always a hard failure
# 2 – provider outage → warning annotation, does NOT block merge
# ---------------------------------------------------------------------------
stellar-testnet-snippets:
name: Stellar snippet testnet validation
runs-on: ubuntu-latest
# No top-level continue-on-error — individual steps control leniency.
needs: extract-sdk-version
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Download published SDK artifact
run: |
echo "Downloading @wraith-protocol/sdk@${{ needs.extract-sdk-version.outputs.sdk-version }}"
cd /tmp
npm pack @wraith-protocol/sdk@${{ needs.extract-sdk-version.outputs.sdk-version }}
- name: Install dependencies with pinned SDK
run: |
pnpm install --frozen-lockfile
pnpm remove @wraith-protocol/sdk
pnpm add /tmp/wraith-protocol-sdk-${{ needs.extract-sdk-version.outputs.sdk-version }}.tgz
- name: Record tested SDK version
run: |
echo "Testing against SDK version: ${{ needs.extract-sdk-version.outputs.sdk-version }}"
# BLOCKING: deterministic content checks only (snippet count, file
# existence). A failure here means a real doc regression. Exit 1.
- name: Validate Stellar snippet content (blocking)
env:
MODE: content
run: pnpm run check:stellar-testnet
# NON-BLOCKING: live provider availability checks.
#
# continue-on-error keeps the job alive regardless of exit status, but it
# collapses outcome/conclusion so we cannot distinguish exit 1 from exit 2
# through those fields alone. We therefore capture the raw exit status
# explicitly and write it to GITHUB_OUTPUT before the shell exits, giving
# the next step a reliable signal to branch on.
#
# Exit codes (defined in check-stellar-testnet-snippets.ts):
# 0 – all checks passed
# 1 – content regression → hard failure, blocks merge
# 2 – provider outage → warning annotation only, does NOT block
- name: Validate Stellar testnet provider availability (non-blocking)
id: provider-check
continue-on-error: true
env:
MODE: provider
run: |
set +e
pnpm run check:stellar-testnet
STATUS=$?
set -e
echo "exit-status=$STATUS" >> "$GITHUB_OUTPUT"
exit $STATUS
# Exit 1 → content regression from a reachable provider; hard-fail.
# Exit 2 → provider outage; emit a warning annotation and continue.
# Exit 0 → all good; nothing to do.
- name: Classify provider-check exit status
if: always()
env:
PROVIDER_EXIT: ${{ steps.provider-check.outputs.exit-status }}
run: |
case "$PROVIDER_EXIT" in
0)
echo "Provider check passed."
;;
1)
echo "::error::Provider step detected a content regression (exit 1). Failing the job."
exit 1
;;
2)
echo "::warning::Provider step reported a testnet outage (exit 2). Non-blocking."
;;
*)
echo "::error::Provider step exited with unexpected status '$PROVIDER_EXIT'. Failing the job."
exit 1
;;
esac
- name: Test exit-status classification logic
run: pnpm run test:stellar-testnet
mint-validation:
name: Mint config validation and preview redirect checks
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Validate Mint navigation and configuration
run: npx --yes mintlify@4.2.1082 validate
- name: Run preview redirect unit tests
run: pnpm run test:preview-redirect
# The live preview check needs a deployed Mintlify preview. It is only
# required when that URL is actually supplied — without one there is
# nothing to verify, and the unit tests above already cover the
# redirect logic.
- name: Verify live preview redirect
if: ${{ env.MINTLIFY_PREVIEW_URL != '' }}
run: node scripts/check-preview-redirect.mjs
playground-smoke:
name: Playground smoke test
runs-on: ubuntu-latest
needs: extract-sdk-version
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Download published SDK artifact
run: |
echo "Downloading @wraith-protocol/sdk@${{ needs.extract-sdk-version.outputs.sdk-version }}"
cd /tmp
npm pack @wraith-protocol/sdk@${{ needs.extract-sdk-version.outputs.sdk-version }}
- name: Install dependencies with pinned SDK
run: |
pnpm install --frozen-lockfile
pnpm remove @wraith-protocol/sdk
pnpm add /tmp/wraith-protocol-sdk-${{ needs.extract-sdk-version.outputs.sdk-version }}.tgz
- name: Record tested SDK version
run: |
echo "Testing against SDK version: ${{ needs.extract-sdk-version.outputs.sdk-version }}"
- name: Verify playground fixtures are in sync
run: pnpm run check:playground-fixtures
- name: Install Playwright browser
run: pnpm exec playwright install --with-deps chromium
- name: Run playground smoke tests
run: pnpm run test:playground
check-stellar-reference:
name: Stellar contract reference check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- name: Install Stellar CLI
# Pinned to the same minor used during the last registry verification.
# Update this pin when the CLI interface changes in a way that affects
# `stellar contract inspect` output parsing.
run: |
curl -sSfL https://github.com/stellar/stellar-cli/releases/download/v28.1.0/stellar-cli-28.1.0-x86_64-unknown-linux-gnu.tar.gz \
| tar -xz -C /usr/local/bin stellar
stellar version
- name: Install dependencies
run: pnpm install --frozen-lockfile
# Only the two contracts that currently have live testnet addresses are
# listed here (from scripts/contract-registry.json, stellar-testnet block).
# stealth-registry and stealth-sender are not yet deployed and are omitted
# until their addresses appear in the registry.
- name: Check Stellar generated reference
env:
STELLAR_CONTRACT_IDS: >-
{
"stealth-announcer": "CCJLJ2QRBJAAKIG6ELNQVXLLWMKKWVN5O2FKWUETHZGMPAD4MHK7WVWL",
"wraith-names": "CDEMB3MAE62ZOCCKZPTYSXR5CS5WVENPOU5MDVK4PNKTZXFVDC74AFBV"
}
STELLAR_NETWORK: testnet
run: >-
pnpm exec tsx scripts/generate-stellar-reference.ts
--check
--require-contracts=stealth-announcer,wraith-names