Skip to content

Commit 8a84c2b

Browse files
authored
Merge pull request #19485 from Veykril/push-mqlnvzkuplnm
chore: Clean CI a bit
2 parents 5308b23 + 1ab2f42 commit 8a84c2b

File tree

1 file changed

+51
-29
lines changed

1 file changed

+51
-29
lines changed

.github/workflows/ci.yaml

Lines changed: 51 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ jobs:
3434
- 'editors/code/**'
3535
3636
proc-macro-srv:
37-
needs: changes
3837
if: github.repository == 'rust-lang/rust-analyzer'
3938
name: proc-macro-srv
4039
runs-on: ubuntu-latest
@@ -72,7 +71,7 @@ jobs:
7271
name: Rust
7372
runs-on: ${{ matrix.os }}
7473
env:
75-
RUSTFLAGS: "-D warnings"
74+
RUSTFLAGS: "-Dwarnings"
7675
CC: deny_c
7776

7877
strategy:
@@ -89,7 +88,7 @@ jobs:
8988
run: |
9089
rustup update --no-self-update stable
9190
rustup default stable
92-
rustup component add --toolchain stable rust-src
91+
rustup component add --toolchain stable rust-src clippy
9392
# We always use a nightly rustfmt, regardless of channel, because we need
9493
# --file-lines.
9594
rustup toolchain install nightly --profile minimal --component rustfmt
@@ -98,24 +97,24 @@ jobs:
9897
if: matrix.os == 'ubuntu-latest'
9998
run: echo "::add-matcher::.github/rust.json"
10099

100+
- name: Bump opt-level
101+
if: matrix.os == 'ubuntu-latest'
102+
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
103+
101104
- name: Cache Dependencies
102-
uses: Swatinem/rust-cache@27b8ea9368cf428f0bfe41b0876b1a7e809d9844
105+
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
103106
with:
104107
workspaces: |
105108
. -> target
106-
crates/proc-macro-srv/proc-macro-test/imp -> target
109+
./crates/proc-macro-srv/proc-macro-test/imp -> target
107110
108111
- uses: taiki-e/install-action@nextest
109112

110-
- name: Bump opt-level
111-
if: matrix.os == 'ubuntu-latest'
112-
run: sed -i '/\[profile.dev]/a opt-level=1' Cargo.toml
113-
114113
- name: Codegen checks (rust-analyzer)
115114
run: cargo codegen --check
116115

117116
- name: Compile (tests)
118-
run: cargo test --no-run --locked
117+
run: cargo test --no-run
119118

120119
# It's faster to `test` before `build` ¯\_(ツ)_/¯
121120
- name: Compile (rust-analyzer)
@@ -126,31 +125,53 @@ jobs:
126125
if: matrix.os == 'ubuntu-latest' || matrix.os == 'windows-latest' || github.event_name == 'push'
127126
run: cargo nextest run --no-fail-fast --hide-progress-bar --status-level fail
128127

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
130142
run: |
131143
rustup update --no-self-update stable
132-
rustup component add --toolchain stable rust-src clippy
133144
rustup default stable
145+
rustup component add rustfmt
134146
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
138149

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/
141154
env:
142155
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
144157

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
148162

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
152174

153-
# Weird targets to catch non-portable code
154175
miri:
155176
if: github.repository == 'rust-lang/rust-analyzer'
156177
name: miri
@@ -163,12 +184,13 @@ jobs:
163184
- name: Install Rust toolchain
164185
run: |
165186
rustup update --no-self-update nightly
166-
rustup component add miri --toolchain nightly
187+
rustup default nightly
188+
rustup component add miri
167189
168190
- name: Cache Dependencies
169-
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
191+
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
170192

171-
- run: cargo +nightly miri test -p intern --locked
193+
- run: cargo miri test -p intern
172194

173195
# Weird targets to catch non-portable code
174196
rust-cross:
@@ -193,7 +215,7 @@ jobs:
193215
rustup target add ${{ env.targets }} ${{ env.targets_ide }}
194216
195217
- name: Cache Dependencies
196-
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
218+
uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
197219

198220
- name: Check
199221
run: |

0 commit comments

Comments
 (0)