@@ -35,19 +35,48 @@ jobs:
35
35
typescript:
36
36
- 'editors/code/**'
37
37
proc_macros:
38
+ - 'crates/tt/**'
38
39
- 'crates/proc-macro-api/**'
39
40
- 'crates/proc-macro-srv/**'
40
41
- 'crates/proc-macro-srv-cli/**'
41
42
42
- rust :
43
+ proc-macro-srv :
43
44
needs : changes
45
+ if : github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.proc_macros == 'true'
46
+ name : proc-macro-srv
47
+ runs-on : ubuntu-latest
48
+ steps :
49
+ - name : Checkout repository
50
+ uses : actions/checkout@v4
51
+ with :
52
+ ref : ${{ github.event.pull_request.head.sha }}
53
+
54
+ - name : Install Rust toolchain
55
+ run : |
56
+ rustup update --no-self-update nightly
57
+ rustup default nightly
58
+ rustup component add --toolchain nightly rust-src rustfmt
59
+ # https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
60
+ - name : Install Rust Problem Matcher
61
+ if : matrix.os == 'ubuntu-latest'
62
+ run : echo "::add-matcher::.github/rust.json"
63
+
64
+ - name : Cache Dependencies
65
+ uses : Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
66
+
67
+ - name : Bump opt-level
68
+ if : matrix.os == 'ubuntu-latest'
69
+ run : sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
70
+
71
+ - name : Test
72
+ run : cargo test --features sysroot-abi -p rust-analyzer -p proc-macro-srv -p proc-macro-srv-cli -p proc-macro-api -- --quiet
73
+
74
+ rust :
44
75
if : github.repository == 'rust-lang/rust-analyzer'
45
76
name : Rust
46
77
runs-on : ${{ matrix.os }}
47
78
env :
48
79
CC : deny_c
49
- RUST_CHANNEL : " ${{ needs.changes.outputs.proc_macros == 'true' && 'nightly' || 'stable' }}"
50
- USE_SYSROOT_ABI : " ${{ needs.changes.outputs.proc_macros == 'true' && '--features sysroot-abi' || '' }}"
51
80
52
81
strategy :
53
82
fail-fast : false
@@ -62,22 +91,19 @@ jobs:
62
91
63
92
- name : Install Rust toolchain
64
93
run : |
65
- rustup update --no-self-update ${{ env.RUST_CHANNEL }}
66
- rustup default ${{ env.RUST_CHANNEL }}
67
- rustup component add --toolchain ${{ env.RUST_CHANNEL }} rust-src
94
+ rustup update --no-self-update stable
95
+ rustup default stable
96
+ rustup component add --toolchain stable rust-src
68
97
# We always use a nightly rustfmt, regardless of channel, because we need
69
98
# --file-lines.
70
- rustup toolchain add nightly --profile minimal
71
- rustup component add --toolchain nightly rustfmt
99
+ rustup toolchain install nightly --profile minimal --component rustfmt
72
100
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
73
101
- name : Install Rust Problem Matcher
74
102
if : matrix.os == 'ubuntu-latest'
75
103
run : echo "::add-matcher::.github/rust.json"
76
104
77
105
- name : Cache Dependencies
78
106
uses : Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
79
- with :
80
- key : ${{ env.RUST_CHANNEL }}
81
107
82
108
- name : Bump opt-level
83
109
if : matrix.os == 'ubuntu-latest'
@@ -87,16 +113,16 @@ jobs:
87
113
run : cargo codegen --check
88
114
89
115
- name : Compile (tests)
90
- run : cargo test --no-run --locked ${{ env.USE_SYSROOT_ABI }}
116
+ run : cargo test --no-run --locked
91
117
92
118
# It's faster to `test` before `build` ¯\_(ツ)_/¯
93
119
- name : Compile (rust-analyzer)
94
120
if : matrix.os == 'ubuntu-latest'
95
- run : cargo build --quiet ${{ env.USE_SYSROOT_ABI }}
121
+ run : cargo build --quiet
96
122
97
123
- name : Test
98
124
if : matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' || github.event_name == 'push'
99
- run : cargo test ${{ env.USE_SYSROOT_ABI }} -- --nocapture --quiet
125
+ run : cargo test -- --quiet
100
126
101
127
- name : Switch to stable toolchain
102
128
run : |
@@ -157,7 +183,7 @@ jobs:
157
183
158
184
typescript :
159
185
needs : changes
160
- if : github.repository == 'rust-lang/rust-analyzer'
186
+ if : github.repository == 'rust-lang/rust-analyzer' && needs.changes.outputs.typescript == 'true'
161
187
name : TypeScript
162
188
strategy :
163
189
fail-fast : false
@@ -169,21 +195,18 @@ jobs:
169
195
steps :
170
196
- name : Checkout repository
171
197
uses : actions/checkout@v4
172
- if : needs.changes.outputs.typescript == 'true'
173
198
174
199
- name : Install Nodejs
175
200
uses : actions/setup-node@v4
176
201
with :
177
202
node-version : 22
178
- if : needs.changes.outputs.typescript == 'true'
179
203
180
204
- name : Install xvfb
181
- if : matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
205
+ if : matrix.os == 'ubuntu-latest'
182
206
run : sudo apt-get install -y xvfb
183
207
184
208
- run : npm ci
185
209
working-directory : ./editors/code
186
- if : needs.changes.outputs.typescript == 'true'
187
210
188
211
# - run: npm audit || { sleep 10 && npm audit; } || { sleep 30 && npm audit; }
189
212
# if: runner.os == 'Linux'
@@ -192,35 +215,31 @@ jobs:
192
215
# If this steps fails, your code's type integrity might be wrong at some places at TypeScript level.
193
216
- run : npm run typecheck
194
217
working-directory : ./editors/code
195
- if : needs.changes.outputs.typescript == 'true'
196
218
197
219
# You may fix the code automatically by running `npm run lint:fix` if this steps fails.
198
220
- run : npm run lint
199
221
working-directory : ./editors/code
200
- if : needs.changes.outputs.typescript == 'true'
201
222
202
223
# To fix this steps, please run `npm run format`.
203
224
- run : npm run format:check
204
225
working-directory : ./editors/code
205
- if : needs.changes.outputs.typescript == 'true'
206
226
207
227
- name : Run VS Code tests (Linux)
208
- if : matrix.os == 'ubuntu-latest' && needs.changes.outputs.typescript == 'true'
228
+ if : matrix.os == 'ubuntu-latest'
209
229
env :
210
230
VSCODE_CLI : 1
211
231
run : xvfb-run npm test
212
232
working-directory : ./editors/code
213
233
214
234
- name : Run VS Code tests (Windows)
215
- if : matrix.os == 'windows-latest' && needs.changes.outputs.typescript == 'true'
235
+ if : matrix.os == 'windows-latest'
216
236
env :
217
237
VSCODE_CLI : 1
218
238
run : npm test
219
239
working-directory : ./editors/code
220
240
221
241
- run : npm run package --scripts-prepend-node-path
222
242
working-directory : ./editors/code
223
- if : needs.changes.outputs.typescript == 'true'
224
243
225
244
typo-check :
226
245
name : Typo Check
@@ -242,7 +261,7 @@ jobs:
242
261
run : typos
243
262
244
263
conclusion :
245
- needs : [rust, rust-cross, typescript, typo-check]
264
+ needs : [rust, rust-cross, typescript, typo-check, proc-macro-srv ]
246
265
# We need to ensure this job does *not* get skipped if its dependencies fail,
247
266
# because a skipped job is considered a success by GitHub. So we have to
248
267
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
@@ -257,5 +276,5 @@ jobs:
257
276
run : |
258
277
# Print the dependent jobs to see them in the CI log
259
278
jq -C <<< '${{ toJson(needs) }}'
260
- # Check if all jobs that we depend on (in the needs array) were successful.
261
- jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
279
+ # Check if all jobs that we depend on (in the needs array) were successful (or have been skipped) .
280
+ jq --exit-status 'all(.result == "success" or .result == "skipped" )' <<< '${{ toJson(needs) }}'
0 commit comments