-
Notifications
You must be signed in to change notification settings - Fork 16
171 lines (160 loc) · 4.97 KB
/
Copy pathci.yml
File metadata and controls
171 lines (160 loc) · 4.97 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
name: CI
on:
pull_request:
push:
branches:
- main
permissions: {}
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
jobs:
test-node:
name: Test Node.js
permissions:
contents: read
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node-version: [22.x, 24.x, 25.x]
runs-on: ${{ matrix.os }}
# Per-endpoint Zod schemas (#171) compile to ~72 MB of .d.ts; tsc needs
# more than the 2 GB Node default to hold the type graph during emit.
env:
NODE_OPTIONS: --max-old-space-size=6144
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: npm ci
- name: Run unit tests
run: npm test
shell: bash
license-header:
name: Check SPDX license header
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
- name: Install
run: npm ci
- name: License header check
run: npm run test:spdx
notice-file:
name: Check NOTICE.txt is up to date
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
- name: Install
run: npm ci
- name: Verify NOTICE.txt
run: npm run test:notice
test-bun:
name: Test Bun
permissions:
contents: read
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
# `bun run build` shells out to Node-hosted tsc; same heap constraint as
# the Node job above.
env:
NODE_OPTIONS: --max-old-space-size=6144
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- name: Install
run: bun install
- name: Build
run: bun run build
- name: Run unit tests
# 30 s per test: Windows runners are slower, and building 500+ Commander
# stubs for the full ES manifest takes longer than bun's 5 s default.
run: bun test --timeout 30000
validate-pr-title:
if: github.event_name == 'pull_request'
name: Validate PR title
permissions:
pull-requests: read
runs-on: ubuntu-latest
steps:
- name: PR Conventional Commit Validation
uses: ytanikin/pr-conventional-commits@639145d78959c53c43112365837e3abd21ed67c1 # v1.5.2
with:
task_types: '["feat","fix","docs","test","ci","refactor","perf","chore","revert"]'
add_label: "false"
megalinter:
name: MegaLinter
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
fetch-depth: 0
- name: MegaLinter
uses: oxsecurity/megalinter/flavors/javascript@ef3e84b8b836d76db562d0f3ed7da61e8fd538bc # v9.6.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' }}
cli-schema:
name: Check CLI schema is up to date
permissions:
contents: read
runs-on: ubuntu-latest
env:
NODE_OPTIONS: --max-old-space-size=6144
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
with:
persist-credentials: false
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
with:
node-version: 24.x
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Regenerate CLI schema
run: npm run build:schema
- name: Check for uncommitted changes
run: |
if ! git diff --exit-code docs/cli/schema.json; then
echo ""
echo "docs/cli/schema.json is out of date. Run 'npm run build:schema' and commit the result."
exit 1
fi
ci:
name: CI Result
if: always()
runs-on: ubuntu-latest
needs:
- test-node
- license-header
- test-bun
- validate-pr-title
- megalinter
- cli-schema
steps:
- run: |
if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more required jobs failed or were cancelled."
exit 1
fi