Repository navigation
107 lines (95 loc) · 3.46 KB
/
Copy pathCI.yml
File metadata and controls
107 lines (95 loc) · 3.46 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
# GitHub Actions docs
# https://help.github.com/en/articles/about-github-actions
# https://help.github.com/en/articles/workflow-syntax-for-github-actions
name: Validate Docs
on: [pull_request]
# A new push supersedes the run before it.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
NODE_VERSION: 24
jobs:
# Needs no dependencies, so it reports in seconds rather than queueing behind
# npm ci and lint.
admonitions:
name: Check Admonitions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
# The check diffs against the pull request base, so it needs history.
fetch-depth: 0
- uses: ./.github/workflows/actions/check-admonitions
# These produce the same verdict on any operating system, so they run once.
checks:
name: Checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: ⚙️ Use Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- name: 🕸️ Install Dependencies
run: npm ci
- name: Test
run: npm run test
- name: 🧩 Typecheck
run: npm run typecheck
- name: 🔤 Spell Check
run: npm run spellcheck
# Docusaurus derives a heading's anchor from its text, so renaming a
# heading moves the anchor and breaks every inbound link. An explicit id
# survives the rename, and lets a translation keep the English anchor
# after the heading text is translated.
#
# Nothing in Docusaurus enforces this: a page whose headings are all
# unpinned builds clean. So run its own generator and fail if it had
# anything to add.
- name: 🔗 Heading IDs
run: |
npm run heading-ids
if ! git diff --quiet -- docs; then
echo "::error::Headings are missing explicit ids. Run \`npm run heading-ids\` and commit the result."
git diff -- docs
exit 1
fi
- uses: ./.github/workflows/actions/check-translations
cross-platform:
name: Cross-platform on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# Prettier rewrites line endings, so Lint is the one check whose
# verdict depends on the operating system.
os: [windows-latest, macOS-latest]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: ⚙️ Use Node.js
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: ${{ env.NODE_VERSION }}
cache: npm
- name: 🕸️ Install Dependencies
run: npm ci
- name: 🖌️ Lint
run: npm run lint
# Lint changes should be pushed to the branch before the branch is merge
# eligible.
- name: 🔍 Check Diff
run: git diff --exit-code
shell: bash
verify:
# The one required check on main and the feature branches, so the jobs
# above can change without touching the protection rules. Renaming this
# blocks merges until those rules are updated to match.
name: Verify
if: ${{ always() }}
needs: [admonitions, checks, cross-platform]
runs-on: ubuntu-latest
steps:
- name: Check job status
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: exit 1