From 90433d282266969b727fdbba202eaaf9b4a57533 Mon Sep 17 00:00:00 2001 From: Alex Todorov Date: Tue, 10 Oct 2023 16:39:18 +0300 Subject: [PATCH] Manually parse Rust toolchain spec b/c actions-rs/toolchain doesn't support rust-toolchain.toml, see https://github.com/actions-rs/toolchain/pull/209 --- .github/workflows/ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 446ae03e..4a68ca5e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,9 +21,15 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Configure rustc version + run: | + RUSTC_VERSION=$(cat rust-toolchain.toml | grep channel | tail -n1 | tr -d " " | cut -f2 -d'"') + echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" + - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: + toolchain: ${{ env.RUSTC_VERSION }} profile: minimal override: true components: rustfmt @@ -40,9 +46,15 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Configure rustc version + run: | + RUSTC_VERSION=$(cat rust-toolchain.toml | grep channel | tail -n1 | tr -d " " | cut -f2 -d'"') + echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" + - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: + toolchain: ${{ env.RUSTC_VERSION }} target: wasm32-unknown-unknown profile: minimal override: true @@ -64,9 +76,15 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v4 + - name: Configure rustc version + run: | + RUSTC_VERSION=$(cat rust-toolchain.toml | grep channel | tail -n1 | tr -d " " | cut -f2 -d'"') + echo "RUSTC_VERSION=$RUSTC_VERSION" >> "$GITHUB_ENV" + - name: Install Rust toolchain uses: actions-rs/toolchain@v1 with: + toolchain: ${{ env.RUSTC_VERSION }} target: wasm32-unknown-unknown profile: minimal override: true