Skip to content

Commit fb204ec

Browse files
committed
chore: toolchain version
1 parent 28caf45 commit fb204ec

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,20 @@ jobs:
2727
restore-keys: |
2828
${{ runner.os }}-cargo-
2929
- name: Set up Rust toolchain version
30-
run: echo "TOOLCHAIN_VERSION=$(cat rust-toolchain | tr -d '\n' | tr -d ' ')" >> $GITHUB_ENV
30+
run: |
31+
if [ ! -f rust-toolchain.toml ]; then
32+
echo "Error: rust-toolchain.toml file not found!" >&2
33+
exit 1
34+
fi
35+
TOOLCHAIN_VERSION=$(grep 'channel' rust-toolchain.toml | cut -d '"' -f2)
36+
echo "TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}" >> $GITHUB_ENV
3137
- name: Install Rust toolchain
3238
run: |
3339
rustup set profile minimal
3440
rustup install "$TOOLCHAIN_VERSION"
3541
rustup default "$TOOLCHAIN_VERSION"
3642
rustup component add rustfmt clippy llvm-tools-preview rustc-dev
37-
rustup show
43+
rustup show
3844
- name: Test
3945
run: cargo test
4046
timeout-minutes: 20
@@ -45,4 +51,4 @@ jobs:
4551
- name: Clippy
4652
run: |
4753
cargo clippy --all-targets -- -D warnings
48-
cargo +$TOOLCHAIN_VERSION clippy --all-targets --all-features -- -D warnings
54+
cargo +$TOOLCHAIN_VERSION clippy --all-targets --all-features -- -D warnings

0 commit comments

Comments
 (0)