diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55b816af..d69fb661 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,17 +22,19 @@ jobs: - name: 'Checkout' uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + - name: 'Setup mise' + uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 + with: + # Disable cache to avoid issues with wasm32 target + # See https://github.com/jdx/mise-action/issues/215 + cache: false + - name: 'Check code' run: | cargo fmt --all -- --check cargo clippy --locked --verbose --tests --benches --workspace -- -D clippy::all cargo clippy --locked --verbose --target wasm32-unknown-unknown -p cksol_minter -- -D clippy::all - - name: 'Install cargo-sort' - uses: taiki-e/install-action@97a5807a604e12de3a13b52d868ebecaeeea757c # v2.75.4 - with: - tool: cargo-sort@2.0.1 - - name: 'Check Cargo.toml' run: cargo sort --workspace --check @@ -72,8 +74,12 @@ jobs: - name: 'Checkout' uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 - - name: 'Install canbench' - run: cargo install canbench --version 0.4.1 --locked + - name: 'Setup mise' + uses: jdx/mise-action@5228313ee0372e111a38da051671ca30fc5a96db # v3 + with: + # Disable cache to avoid issues with wasm32 target + # See https://github.com/jdx/mise-action/issues/215 + cache: false - name: 'Run benchmarks' run: cd minter && canbench --less-verbose diff --git a/README.md b/README.md index 5e37b8f6..fae4fa41 100644 --- a/README.md +++ b/README.md @@ -243,17 +243,22 @@ icp canister call -e prod cksol_minter withdrawal_status \ ### Prerequisites -- [Rust](https://rustup.rs/) — the correct toolchain version is pinned in `rust-toolchain.toml`. -- [`ic-wasm`](https://github.com/dfinity/ic-wasm) version 0.3.5 — used for Wasm post-processing. -- `jq` — used by `./scripts/build` to generate Wasm metadata. -- `gzip` — used by `./scripts/build` to compress the output Wasm. - -Install the Rust toolchain and `ic-wasm` by running: +Install [`mise`](https://mise.jdx.dev/) and then provision the pinned toolchain +(Rust 1.93.0 with the `wasm32-unknown-unknown` target, `cargo-sort`, `canbench`): ```sh -./scripts/bootstrap +mise install ``` +Tool versions are defined in [`mise.toml`](./mise.toml) so local and CI +environments stay in sync. + +Additionally: + +- [`ic-wasm`](https://github.com/dfinity/ic-wasm) version 0.3.5 — used for Wasm post-processing. Install via `./scripts/bootstrap`. +- `jq` — used by `./scripts/build` to generate Wasm metadata. +- `gzip` — used by `./scripts/build` to compress the output Wasm. + ### Building Build the minter Wasm: diff --git a/mise.toml b/mise.toml new file mode 100644 index 00000000..fe7d2868 --- /dev/null +++ b/mise.toml @@ -0,0 +1,6 @@ +[tools] +"cargo:cargo-sort" = "2.0.1" +"cargo:canbench" = "0.4.1" + +[settings] +idiomatic_version_file_enable_tools = ["rust"]