diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index c69df9d2ba5..1bb3e7bd530 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -37,9 +37,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal + - uses: Twey/setup-rust-toolchain@v1 - name: Install Protoc uses: arduino/setup-protoc@v1 with: @@ -59,9 +57,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal + - uses: Twey/setup-rust-toolchain@v1 - name: Checkout docs.rs tool repository run: | cd ${{ runner.temp }} diff --git a/.github/workflows/dynamodb.yml b/.github/workflows/dynamodb.yml index 0df7ba93df1..d90d1d31537 100644 --- a/.github/workflows/dynamodb.yml +++ b/.github/workflows/dynamodb.yml @@ -36,11 +36,7 @@ jobs: runs-on: ubuntu-latest-16-cores steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - target: wasm32-unknown-unknown - - uses: Swatinem/rust-cache@v2 + - uses: Twey/setup-rust-toolchain@v1 - name: Install Protoc uses: arduino/setup-protoc@v1 with: diff --git a/.github/workflows/explorer.yml b/.github/workflows/explorer.yml index 920d0332e82..b41477e97aa 100644 --- a/.github/workflows/explorer.yml +++ b/.github/workflows/explorer.yml @@ -36,11 +36,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - target: wasm32-unknown-unknown - - uses: Swatinem/rust-cache@v2 + - uses: Twey/setup-rust-toolchain@v1 - name: Build run: | cd linera-explorer diff --git a/.github/workflows/kubernetes.yml b/.github/workflows/kubernetes.yml index 9a04b58f091..0dc76894581 100644 --- a/.github/workflows/kubernetes.yml +++ b/.github/workflows/kubernetes.yml @@ -34,10 +34,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - - uses: Swatinem/rust-cache@v2 + - uses: Twey/setup-rust-toolchain@v1 - name: Install Protoc uses: arduino/setup-protoc@v1 with: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2bf378a318d..555c322dd2d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -37,12 +37,7 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - target: wasm32-unknown-unknown - components: clippy, rustfmt - - uses: Swatinem/rust-cache@v2 + - uses: Twey/setup-rust-toolchain@v1 - name: Clear up some space run: | sudo rm -rf /usr/share/dotnet @@ -102,17 +97,11 @@ jobs: run: > find linera-* -name '*.rs' -a -not -wholename '*/target/*' -print0 | xargs -0 -L1 ./scripts/target/release/check_copyright_header - - uses: actions-rs/toolchain@v1 + - uses: Twey/setup-rust-toolchain@v1 with: - profile: minimal + toolchain: nightly-2023-10-22 target: wasm32-unknown-unknown - components: clippy - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: nightly - components: rustfmt - - uses: Swatinem/rust-cache@v2 + components: clippy rustfmt - name: Install cargo-machete run: | cargo install cargo-machete --locked @@ -131,7 +120,7 @@ jobs: cargo install cargo-sort --locked - name: Check formatting run: | - cargo +nightly fmt -- --check + cargo +nightly-2023-10-22 fmt -- --check - name: Check for unused dependencies run: | cargo machete @@ -143,7 +132,7 @@ jobs: - name: Run Wasm application lints run: | cd examples - cargo +nightly fmt -- --check + cargo fmt -- --check cargo clippy --all-targets --all-features --target wasm32-unknown-unknown --locked cargo clippy --all-targets --all-features --target x86_64-unknown-linux-gnu --locked - name: Run clippy diff --git a/.github/workflows/scylladb.yml b/.github/workflows/scylladb.yml index 7f24be39867..30c30affa29 100644 --- a/.github/workflows/scylladb.yml +++ b/.github/workflows/scylladb.yml @@ -36,11 +36,7 @@ jobs: runs-on: ubuntu-latest-16-cores steps: - uses: actions/checkout@v3 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - target: wasm32-unknown-unknown - - uses: Swatinem/rust-cache@v2 + - uses: Twey/setup-rust-toolchain@v1 - name: Install Protoc uses: arduino/setup-protoc@v1 with: diff --git a/linera-service/src/project.rs b/linera-service/src/project.rs index 39419782c4e..39c7f558b95 100644 --- a/linera-service/src/project.rs +++ b/linera-service/src/project.rs @@ -48,7 +48,7 @@ impl Project { debug!("writing Cargo.toml"); Self::create_cargo_toml(&root, name, linera_root)?; - debug!("writing rust-toolchain"); + debug!("writing rust-toolchain.toml"); Self::create_rust_toolchain(&root)?; debug!("writing state.rs"); @@ -167,15 +167,10 @@ impl Project { } fn create_rust_toolchain(project_root: &Path) -> Result<()> { - Self::write_string_to_file( - &project_root.join("rust-toolchain"), - include_str!("../template/rust-toolchain.template"), - )?; Self::write_string_to_file( &project_root.join("rust-toolchain.toml"), include_str!("../template/rust-toolchain.toml.template"), - )?; - Ok(()) + ) } fn create_state_file(source_directory: &Path) -> Result<()> { diff --git a/linera-service/template/rust-toolchain.template b/linera-service/template/rust-toolchain.template deleted file mode 120000 index 5c314678a8c..00000000000 --- a/linera-service/template/rust-toolchain.template +++ /dev/null @@ -1 +0,0 @@ -../../rust-toolchain \ No newline at end of file diff --git a/rust-toolchain b/rust-toolchain deleted file mode 100644 index 0834888f558..00000000000 --- a/rust-toolchain +++ /dev/null @@ -1 +0,0 @@ -1.72.0 diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2dc71a0d379..aeda7dba630 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,5 @@ [toolchain] channel = "1.72.0" -components = [ "rustfmt", "rustc-dev", "rust-src" ] +components = [ "clippy", "rustfmt", "rust-src" ] targets = [ "wasm32-unknown-unknown" ] +profile = "minimal"