ci_install_rust.sh 613 Bytes
Newer Older
1
2
3
#!/bin/bash
set -euxo pipefail

4
5
6
# Check if sudo is available
if command -v sudo >/dev/null 2>&1; then
    sudo apt-get update
7
    sudo apt-get install -y libssl-dev pkg-config protobuf-compiler
8
9
else
    apt-get update
10
    apt-get install -y libssl-dev pkg-config protobuf-compiler
11
fi
12
13

# Install rustup (Rust installer and version manager)
14
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.90
15
16
17


# Follow the installation prompts, then reload your shell
18
. "$HOME/.cargo/env"
19
20
21
22
source $HOME/.cargo/env

# Verify installation
rustc --version
23
cargo --version
24
protoc --version