Skip to content

Commit ad2eec3

Browse files
committed
Codify linting toolchain in a toolchain file
Moves the nightly toolchain we use for linting out of a GitHub action and into a dedicated `rust-toolchain.lint.toml` file. rustup doesn't currently support specifying a toolchain file, though [it will soon](rust-lang/rustup#2686), so we hack around it by moving the toolchain file back and forth as part of the GitHub action for Rust.
1 parent 4ba192d commit ad2eec3

File tree

4 files changed

+14
-9
lines changed

4 files changed

+14
-9
lines changed

.github/workflows/rust.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ jobs:
102102
run: >
103103
find linera-* -name '*.rs' -a -not -wholename '*/target/*' -print0
104104
| xargs -0 -L1 ./scripts/target/release/check_copyright_header
105+
- name: Put lint toolchain file in place
106+
run: |
107+
ln -sf rust-toolchain.lint.toml rust-toolchain.toml
105108
- uses: Twey/setup-rust-toolchain@v1
106-
with:
107-
toolchain: nightly-2023-10-22
108-
target: wasm32-unknown-unknown
109-
components: clippy rustfmt
109+
working-directory: toolchains/lint
110110
- name: Install cargo-machete
111111
run: |
112112
cargo install cargo-machete --locked

rust-toolchain.toml

-5
This file was deleted.

rust-toolchain.toml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
toolchains/build/rust-toolchain.toml

toolchains/build/rust-toolchain.toml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[toolchain]
2+
channel = "1.73.0"
3+
components = [ "clippy", "rustfmt", "rust-src" ]
4+
targets = [ "wasm32-unknown-unknown" ]
5+
profile = "minimal"

toolchains/lint/rust-toolchain.toml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[toolchain]
2+
channel = "nightly-2023-10-23"
3+
components = [ "clippy", "rustfmt" ]
4+
profile = "minimal"

0 commit comments

Comments
 (0)