From 95f99a2e085890b6733afe73c0ab55d513a55429 Mon Sep 17 00:00:00 2001 From: sksat Date: Wed, 8 Jan 2025 17:10:31 +0900 Subject: [PATCH] specify Rust toolchain version in CI with rust-toolchain.toml --- .github/workflows/pytest.yml | 6 ++++++ .github/workflows/rust.yml | 7 ++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 026ebeda..3e5f3b4e 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -68,8 +68,14 @@ jobs: ./examples/mobc/tools/.crates2.json key: ${{ matrix.c2a_user }}-${{ runner.os }}-tools-${{ hashFiles('${{ matrix.c2a_user }}/tools/install.sh', '${{ matrix.c2a_user }}/tools/package.json') }} + - name: Get Rust toolchain + id: toolchain + run: | + awk -F'[ ="]+' '$1 == "channel" { print "toolchain=" $2 }' rust-toolchain.toml >> "$GITHUB_OUTPUT" + - uses: dtolnay/rust-toolchain@stable with: + toolchain: ${{ steps.toolchain.outputs.toolchain }} targets: i686-unknown-linux-gnu components: clippy, rustfmt diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 76c5ba01..6dcdaa9f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -24,9 +24,14 @@ jobs: sudo apt-get update -y sudo apt-get install -y gcc-multilib g++-multilib + - name: Get Rust toolchain + id: toolchain + run: | + awk -F'[ ="]+' '$1 == "channel" { print "toolchain=" $2 }' rust-toolchain.toml >> "$GITHUB_OUTPUT" + - uses: dtolnay/rust-toolchain@v1 with: - toolchain: stable + toolchain: ${{ steps.toolchain.outputs.toolchain }} targets: i686-unknown-linux-gnu components: clippy, rustfmt