diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 93e2e9a95232..6df999891a41 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -31,7 +31,6 @@ permissions: contents: read jobs: - test: runs-on: ubuntu-latest-16-cores timeout-minutes: 45 @@ -103,11 +102,10 @@ jobs: run: > find linera-* -name '*.rs' -a -not -wholename '*/target/*' -print0 | xargs -0 -L1 ./scripts/target/release/check_copyright_header + - name: Put lint toolchain file in place + run: | + ln -sf toolchains/lint/rust-toolchain.toml - uses: Twey/setup-rust-toolchain@v1 - with: - toolchain: nightly-2023-10-22 - target: wasm32-unknown-unknown - components: clippy rustfmt - name: Install cargo-machete run: | cargo install cargo-machete --locked @@ -126,7 +124,7 @@ jobs: cargo install cargo-sort --locked - name: Check formatting run: | - cargo +nightly-2023-10-22 fmt -- --check + cargo fmt -- --check - name: Check for unused dependencies run: | cargo machete @@ -161,3 +159,7 @@ jobs: run: | cd examples cargo sort -c -w + - name: Restore `rust-toolchain.toml` file + if: '!cancelled()' + run: | + ln -sf toolchains/build/rust-toolchain.toml diff --git a/toolchains/build/rust-toolchain.toml b/toolchains/build/rust-toolchain.toml new file mode 100644 index 000000000000..bbd74155ccf0 --- /dev/null +++ b/toolchains/build/rust-toolchain.toml @@ -0,0 +1,5 @@ +[toolchain] +channel = "1.73.0" +components = [ "clippy", "rustfmt", "rust-src" ] +targets = [ "wasm32-unknown-unknown" ] +profile = "minimal" diff --git a/toolchains/lint/rust-toolchain.toml b/toolchains/lint/rust-toolchain.toml new file mode 100644 index 000000000000..014ff528dcc7 --- /dev/null +++ b/toolchains/lint/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "nightly-2023-10-23" +components = [ "clippy", "rustfmt" ] +profile = "minimal"