34
34
- 'editors/code/**'
35
35
36
36
proc-macro-srv :
37
- needs : changes
38
37
if : github.repository == 'rust-lang/rust-analyzer'
39
38
name : proc-macro-srv
40
39
runs-on : ubuntu-latest
72
71
name : Rust
73
72
runs-on : ${{ matrix.os }}
74
73
env :
75
- RUSTFLAGS : " -D warnings "
74
+ RUSTFLAGS : " -Dwarnings "
76
75
CC : deny_c
77
76
78
77
strategy :
89
88
run : |
90
89
rustup update --no-self-update stable
91
90
rustup default stable
92
- rustup component add --toolchain stable rust-src
91
+ rustup component add --toolchain stable rust-src clippy
93
92
# We always use a nightly rustfmt, regardless of channel, because we need
94
93
# --file-lines.
95
94
rustup toolchain install nightly --profile minimal --component rustfmt
@@ -98,24 +97,24 @@ jobs:
98
97
if : matrix.os == 'ubuntu-latest'
99
98
run : echo "::add-matcher::.github/rust.json"
100
99
100
+ - name : Bump opt-level
101
+ if : matrix.os == 'ubuntu-latest'
102
+ run : sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
103
+
101
104
- name : Cache Dependencies
102
- uses : Swatinem/rust-cache@27b8ea9368cf428f0bfe41b0876b1a7e809d9844
105
+ uses : Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
103
106
with :
104
107
workspaces : |
105
108
. -> target
106
- crates/proc-macro-srv/proc-macro-test/imp -> target
109
+ ./ crates/proc-macro-srv/proc-macro-test/imp -> target
107
110
108
111
- uses : taiki-e/install-action@nextest
109
112
110
- - name : Bump opt-level
111
- if : matrix.os == 'ubuntu-latest'
112
- run : sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
113
-
114
113
- name : Codegen checks (rust-analyzer)
115
114
run : cargo codegen --check
116
115
117
116
- name : Compile (tests)
118
- run : cargo test --no-run --locked
117
+ run : cargo test --no-run
119
118
120
119
# It's faster to `test` before `build` ¯\_(ツ)_/¯
121
120
- name : Compile (rust-analyzer)
@@ -126,31 +125,53 @@ jobs:
126
125
if : matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' || github.event_name == 'push'
127
126
run : cargo nextest run --no-fail-fast --hide-progress-bar --status-level fail
128
127
129
- - name : Switch to stable toolchain
128
+ - name : clippy
129
+ if : matrix.os == 'macos-latest'
130
+ run : cargo clippy --all-targets -- -D clippy::disallowed_macros -D clippy::dbg_macro -D clippy::todo -D clippy::print_stdout -D clippy::print_stderr
131
+
132
+ analysis-stats :
133
+ if : github.repository == 'rust-lang/rust-analyzer'
134
+ name : miri
135
+ runs-on : ubuntu-latest
136
+
137
+ steps :
138
+ - name : Checkout repository
139
+ uses : actions/checkout@v4
140
+
141
+ - name : Install Rust toolchain
130
142
run : |
131
143
rustup update --no-self-update stable
132
- rustup component add --toolchain stable rust-src clippy
133
144
rustup default stable
145
+ rustup component add rustfmt
134
146
135
- - name : Run analysis-stats on rust-analyzer
136
- if : matrix.os == 'ubuntu-latest'
137
- run : target/${{ matrix.target }}/debug/rust-analyzer analysis-stats .
147
+ - name : Cache Dependencies
148
+ uses : Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
138
149
139
- - name : Run analysis-stats on the rust standard libraries
140
- if : matrix.os == 'ubuntu-latest'
150
+ - name : ./rust-analyzer
151
+ run : cargo run -p rust-analyzer -- analysis-stats . -q
152
+
153
+ - name : sysroot/lib/rustlib/src/rust/library/
141
154
env :
142
155
RUSTC_BOOTSTRAP : 1
143
- run : target/${{ matrix.target }}/debug/ rust-analyzer analysis-stats --with-deps --no-sysroot --no-test $(rustc --print sysroot)/lib/rustlib/src/rust/library/
156
+ run : cargo run -p rust-analyzer -- analysis-stats --with-deps --no-sysroot --no-test $(rustc --print sysroot)/lib/rustlib/src/rust/library/ -q
144
157
145
- - name : clippy
146
- if : matrix.os == 'macos-latest'
147
- run : cargo clippy --all-targets -- -D clippy::disallowed_macros -D clippy::dbg_macro -D clippy::todo -D clippy::print_stdout -D clippy::print_stderr
158
+ rustfmt :
159
+ if : github.repository == 'rust-lang/rust-analyzer'
160
+ name : miri
161
+ runs-on : ubuntu-latest
148
162
149
- - name : rustfmt
150
- if : matrix.os == 'ubuntu-latest'
151
- run : cargo fmt -- --check
163
+ steps :
164
+ - name : Checkout repository
165
+ uses : actions/checkout@v4
166
+
167
+ - name : Install Rust toolchain
168
+ run : |
169
+ rustup update --no-self-update stable
170
+ rustup default stable
171
+ rustup component add rustfmt
172
+
173
+ - run : cargo fmt -- --check
152
174
153
- # Weird targets to catch non-portable code
154
175
miri :
155
176
if : github.repository == 'rust-lang/rust-analyzer'
156
177
name : miri
@@ -163,12 +184,13 @@ jobs:
163
184
- name : Install Rust toolchain
164
185
run : |
165
186
rustup update --no-self-update nightly
166
- rustup component add miri --toolchain nightly
187
+ rustup default nightly
188
+ rustup component add miri
167
189
168
190
- name : Cache Dependencies
169
- uses : Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
191
+ uses : Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
170
192
171
- - run : cargo +nightly miri test -p intern --locked
193
+ - run : cargo miri test -p intern
172
194
173
195
# Weird targets to catch non-portable code
174
196
rust-cross :
@@ -193,7 +215,7 @@ jobs:
193
215
rustup target add ${{ env.targets }} ${{ env.targets_ide }}
194
216
195
217
- name : Cache Dependencies
196
- uses : Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
218
+ uses : Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
197
219
198
220
- name : Check
199
221
run : |
0 commit comments