-
Notifications
You must be signed in to change notification settings - Fork 0
114 lines (93 loc) · 3.73 KB
/
Copy pathci.yml
File metadata and controls
114 lines (93 loc) · 3.73 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
name: CI
on:
push:
branches: [main]
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
permissions:
contents: read
jobs:
# ======== lint + unit tests: Linux only ========
# Nothing under test here branches on `process.platform`: the three places
# that do (`detection.ts` bin names, `stacks/lint/utils.ts` platform
# packages, `stacks/test/projectCoverage.ts` path casing) are only reachable
# when the host *is* that platform, so a second OS would re-run identical
# assertions. The Windows branches are covered by the Windows E2E job below.
ut:
name: UT (ubuntu-latest)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 1
- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- name: Setup Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Install Dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: pnpm run build
- name: Lint
run: pnpm run lint
- name: Format Check
run: pnpm run fmt:check
- name: Unit Test
run: pnpm run test:unit
# ======== E2E: Windows + macOS, no Linux ========
# These are the platforms the extension is actually used on, and the only
# ones upstream rstest runs its ported VS Code suites on. Linux is excluded
# deliberately: the Extension Host needs xvfb there, and inotify reports a
# non-atomic file rewrite as separate truncate/write events, so fixture edits
# in the watch-mode suites race the watcher in a way no user hits. Do not add
# a Linux E2E job back without also making every fixture edit atomic.
e2e:
name: E2E (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 40
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
fetch-depth: 1
- name: Setup pnpm
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- name: Setup Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
node-version: 22
cache: 'pnpm'
cache-dependency-path: pnpm-lock.yaml
- name: Install Dependencies
run: pnpm install --frozen-lockfile --prefer-offline
- name: Build
run: pnpm run build
# `@vscode/test-electron` downloads a full VS Code into
# `packages/vscode/.vscode-test`. Cache only the immutable distribution
# directories, keyed on the extension manifest (which carries
# `engines.vscode`); the restore-keys fallback keeps older downloads
# available while `version: 'stable'` moves forward.
- name: Cache VS Code Download
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: packages/vscode/.vscode-test/vscode-*
key: vscode-test-${{ runner.os }}-${{ hashFiles('packages/vscode/package.json') }}
restore-keys: |
vscode-test-${{ runner.os }}-
# The E2E fixtures install published npm packages at test time
# (e2e/setupFixtures.mjs, invoked by test:e2e), so this step needs
# network access.
- name: E2E Test
run: pnpm run test:e2e