-
Notifications
You must be signed in to change notification settings - Fork 13.8k
358 lines (339 loc) · 12.6 KB
/
Copy pathci.yml
File metadata and controls
358 lines (339 loc) · 12.6 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
name: CI
on:
push:
branches: [main, main-ts7, ts7-release, 'release-*']
pull_request:
branches: [main, main-ts7, ts7-release, 'release-*']
merge_group:
branches: [main, main-ts7, ts7-release, 'release-*']
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
- uses: ./.github/actions/setup-go
- run: npm ci
- run: npx hereby build
- run: npx hereby build:api
release-build:
if: ${{ github.repository == 'microsoft/TypeScript' && github.event_name != 'merge_group' }}
runs-on: TypeScript-1ES-GitHub-TypeScript-1
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
- uses: ./.github/actions/setup-go
- run: npm ci
- run: npx hereby typescript:release --forRelease --setPrerelease dev.0.0
extension:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
- run: npm ci
- run: npm run extension:build
package-feed-proxy:
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
package-manager-cache: false
- run: npm ci --registry=https://packagefeedproxy.microsoft.io/npm/
go-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup-go
- name: Prepare standalone tsc module
run: |
mkdir "$RUNNER_TEMP/go-test-bin"
ln -s "$(go env GOROOT)/bin/go" "$RUNNER_TEMP/go-test-bin/go"
cp -R tsc "$RUNNER_TEMP/tsc"
- name: Tests without Node.js
run: |
export PATH="$RUNNER_TEMP/go-test-bin"
export GOEXPERIMENT=ms_nocgo_opensslcrypto
export CGO_ENABLED=0
! command -v node
cd "$RUNNER_TEMP/tsc"
go test ./...
go test -run=- -bench=. -benchtime=1x ./...
test:
strategy:
fail-fast: ${{ github.event_name == 'merge_group' }}
matrix:
config:
- runner: ubuntu-latest
os: linux
coverage: true
main: true
- runner: windows-latest
os: windows
coverage: true
skip: ${{ github.event_name == 'merge_group' }}
- runner: macos-latest
os: macos
coverage: true
skip: ${{ github.event_name == 'merge_group' || github.event_name == 'pull_request' }}
- runner: TypeScript-1ES-GitHub-TypeScript-1
os: linux
name: 'race mode'
race: true
skip: ${{ github.event_name == 'merge_group' || github.repository != 'microsoft/TypeScript' }}
- runner: ubuntu-latest
os: linux
name: 'noembed'
noembed: true
- runner: ubuntu-latest
os: linux
name: 'concurrent test programs'
concurrent-test-programs: true
coverage: true
skip: ${{ github.event_name == 'merge_group' }}
exclude:
- config:
skip: true
name: test (${{ matrix.config.name || matrix.config.runner }})
runs-on: ${{ matrix.config.runner }}
permissions:
id-token: write
contents: read
env:
TSGO_HEREBY_RACE: ${{ (matrix.config.race && 'true') || 'false' }}
TSGO_HEREBY_NOEMBED: ${{ (matrix.config.noembed && 'true') || 'false' }}
TSGO_HEREBY_CONCURRENT_TEST_PROGRAMS: ${{ (matrix.config.concurrent-test-programs && 'true') || 'false' }}
TSGO_HEREBY_COVERAGE: ${{ (matrix.config.coverage && github.event_name != 'merge_group' && 'true') || 'false' }}
steps:
- run: git config --system core.longpaths true
if: ${{ matrix.config.os == 'windows' }}
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
- uses: ./.github/actions/setup-go
- if: ${{ !matrix.config.main }}
name: Disable PR annotations
run: |
echo "::remove-matcher owner=eslint-compact::"
echo "::remove-matcher owner=eslint-stylish::"
echo "::remove-matcher owner=tsc::"
echo "::remove-matcher owner=go::"
- run: npm ci
- run: go install gotest.tools/gotestsum@latest
if: ${{ matrix.config.os != 'windows' && !matrix.config.race }}
- name: Tests
id: test
run: npx hereby test:tsc
- name: Benchmarks
run: npx hereby test:benchmarks
- run: git add .
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
if: ${{ always() && matrix.config.coverage && github.event_name != 'merge_group' }}
with:
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}
name: ${{ matrix.config.name || matrix.config.runner }}
directory: ./coverage
- run: git diff --staged --exit-code --stat
- name: Print baseline diff on failure
if: ${{ failure() && steps.test.conclusion == 'failure' }}
run: |
npx hereby baseline-accept
git add tsc/testdata/baselines/reference
git diff --staged --exit-code
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: ${{ failure() && steps.test.conclusion == 'failure' }}
with:
name: ${{ matrix.config.name || matrix.config.os }}-new-baselines
path: tsc/testdata/baselines/local
test-extra:
strategy:
fail-fast: ${{ github.event_name == 'merge_group' }}
matrix:
config:
- runner: ubuntu-latest
os: linux
coverage: true
main: true
- runner: windows-latest
os: windows
coverage: true
skip: ${{ github.event_name == 'merge_group' }}
- runner: macos-latest
os: macos
coverage: true
skip: ${{ github.event_name == 'merge_group' || github.event_name == 'pull_request' }}
exclude:
- config:
skip: true
name: test extra (${{ matrix.config.runner }})
runs-on: ${{ matrix.config.runner }}
permissions:
id-token: write
contents: read
env:
TSGO_HEREBY_COVERAGE: ${{ (matrix.config.coverage && github.event_name != 'merge_group' && 'true') || 'false' }}
steps:
- run: git config --system core.longpaths true
if: ${{ matrix.config.os == 'windows' }}
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
- uses: ./.github/actions/setup-go
- if: ${{ !matrix.config.main }}
name: Disable PR annotations
run: |
echo "::remove-matcher owner=eslint-compact::"
echo "::remove-matcher owner=eslint-stylish::"
echo "::remove-matcher owner=tsc::"
echo "::remove-matcher owner=go::"
- run: npm ci
- run: go install gotest.tools/gotestsum@latest
if: ${{ matrix.config.os != 'windows' }}
- run: npx hereby test:extension
- run: npx hereby test:tools
- run: npx hereby test:api
- run: git add .
- uses: codecov/codecov-action@fb8b3582c8e4def4969c97caa2f19720cb33a72f # v7.0.0
if: ${{ always() && matrix.config.coverage && github.event_name != 'merge_group' }}
with:
use_oidc: ${{ !(github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork) }}
name: extra-${{ matrix.config.runner }}
directory: ./coverage
- run: git diff --staged --exit-code --stat
lint:
strategy:
fail-fast: ${{ github.event_name == 'merge_group' }}
matrix:
config:
- runner: ubuntu-latest
os: linux
main: true
- runner: windows-latest
os: windows
skip: ${{ github.event_name == 'merge_group' }}
- runner: ubuntu-latest
os: linux
name: 'noembed'
noembed: true
skip: ${{ github.event_name == 'merge_group' }}
exclude:
- config:
skip: true
name: lint (${{ matrix.config.name || matrix.config.runner }})
runs-on: ${{ matrix.config.runner }}
env:
TSGO_HEREBY_NOEMBED: ${{ (matrix.config.noembed && 'true') || 'false' }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
- uses: ./.github/actions/setup-go
- if: ${{ !matrix.config.main }}
name: Disable PR annotations
run: |
echo "::remove-matcher owner=eslint-compact::"
echo "::remove-matcher owner=eslint-stylish::"
echo "::remove-matcher owner=tsc::"
echo "::remove-matcher owner=go::"
- run: npm ci
- run: npx hereby lint
format:
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
- uses: ./.github/actions/setup-go
- run: npm ci
- run: npx hereby check:format
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: '>=22.16.0'
- uses: ./.github/actions/setup-go
- run: npm ci
- run: npx hereby generate
- run: npx hereby generate:enums
- run: npx hereby generate:ast
- run: npx hereby generate:vendor
- run: node --experimental-strip-types ./tsc/internal/lsp/lsproto/_generate/fetchModel.mts
- run: node --experimental-strip-types ./tsc/internal/lsp/lsproto/_generate/generate.mts
- run: npx hereby generate:extension
- run: npx hereby check:scripts
- run: git add .
- run: git diff --staged --exit-code --stat
tidy:
runs-on: ubuntu-slim
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: ./.github/actions/setup-go
- run: go -C ./tsc mod tidy -diff
- run: go -C ./tools mod tidy -diff
- run: go work sync
- run: git diff --exit-code
smoke:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
- uses: ./.github/actions/setup-go
- run: npm ci
- run: npx hereby build --race
- run: ./built/local/tsc -p ./tsc/testdata/fixtures/compiler --noEmit --singleThreaded
- run: ./built/local/tsc -p ./tsc/testdata/fixtures/compiler --noEmit
misc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 'lts/*'
- uses: ./.github/actions/setup-go
- run: npm ci
- run: go -C ./tools run ./cmd/checkmodpaths "$PWD"
- run: npx hereby check:scripts
- run: npx hereby typescript:check-platforms
required:
runs-on: ubuntu-slim
if: ${{ always() }}
needs:
- build
- release-build
- extension
- format
- generate
- go-test
- lint
- misc
- package-feed-proxy
- smoke
- test
- test-extra
- tidy
steps:
- name: Check required jobs
env:
NEEDS: ${{ toJson(needs) }}
run: |
! echo "$NEEDS" | jq -e 'to_entries[] | { job: .key, result: .value.result } | select((.result == "success" or .result == "skipped") | not)'