diff options
Diffstat (limited to 'ci')
| -rwxr-xr-x | ci/ci-rust-script.sh | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ci/ci-rust-script.sh b/ci/ci-rust-script.sh index 79e34731af..e4f03cc29d 100755 --- a/ci/ci-rust-script.sh +++ b/ci/ci-rust-script.sh @@ -12,9 +12,12 @@ if [ "${RUST_TOOLCHAIN_CHANNEL}" = "nightly" ]; then RUST_EXTRA_COMPONENTS+=" -c rustfmt-preview" fi -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ - sh -s -- -y --default-toolchain $RUST_TOOLCHAIN_CHANNEL --profile minimal $RUST_EXTRA_COMPONENTS -source $HOME/.cargo/env +# Install Rust if on Linux or macOS +if [[ "$(uname -s)" == "Linux" || "$(uname -s)" == "Darwin" ]]; then + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- \ + -y --default-toolchain $RUST_TOOLCHAIN_CHANNEL --profile minimal $RUST_EXTRA_COMPONENTS + source $HOME/.cargo/env +fi case "$(uname -s)" in MINGW*|MSYS_NT*) @@ -29,7 +32,7 @@ if [ "${RUST_TOOLCHAIN_CHANNEL}" != "nightly" ]; then cargo test --locked --verbose fi -if [ "${RUST_TOOLCHAIN_CHANNEL}" = "nightly" ]; then +if [[ "${RUST_TOOLCHAIN_CHANNEL}" == "nightly" && "$(uname -s)" == "Linux" ]]; then rustfmt --version; cargo fmt -- --check --unstable-features; fi |
