Repository navigation
53 lines (49 loc) · 1.92 KB
/
Copy pathweb-scripts-tests.yml
File metadata and controls
53 lines (49 loc) · 1.92 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
name: Web Scripts Tests
# Runs the node:test suites under web/scripts/ (for example the blog
# announcement helper). The web workspace's vitest config only picks up
# sites/*/src/**/*.test.ts, so these never ran in CI, and a dedupe query that
# matched nothing passed its mocked tests for weeks. This job runs them on every
# PR that touches the scripts or the blog workflows that call them.
#
# It also tests tools/build/scripts/build-docs-index.mjs, which builds the
# offline index `wheels lookup` reads, and builds that index from the PR's
# guides and API JSON: a guide page the builder can't parse fails here, not at
# release time.
on:
pull_request:
paths:
- 'web/scripts/**'
- '.github/workflows/blog-*.yml'
- '.github/scripts/blog-*.sh'
- '.github/workflows/web-scripts-tests.yml'
- 'tools/build/scripts/build-docs-index*.mjs'
- 'web/sites/guides/src/content/**'
- 'docs/api/**'
push:
branches: [develop]
paths:
- 'web/scripts/**'
- '.github/workflows/web-scripts-tests.yml'
- 'tools/build/scripts/build-docs-index*.mjs'
permissions:
contents: read
jobs:
node-tests:
name: web/scripts node tests
runs-on: ubuntu-24.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
# Node 22 expands the quoted glob itself (a bare directory argument is
# treated as one file and fails).
- name: Run node tests
run: node --test 'web/scripts/**/*.test.mjs'
- name: Run the docs index builder's tests
run: node --test 'tools/build/scripts/*.test.mjs'
# Not --strict: a PR tree may not have its version's API JSON yet (it is
# generated at the snapshot build and committed at the release cut).
- name: Build the docs index from this tree
run: node tools/build/scripts/build-docs-index.mjs --out "$RUNNER_TEMP/docs-index.json"