ci: consolidate rust + protoc install across workflows (#23700)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
b3ead32d3c
commit
c3ab5bec7d
@@ -1,24 +1,28 @@
|
||||
#!/bin/bash
|
||||
# Install dependencies for the sgl-model-gateway CI jobs.
|
||||
#
|
||||
# Gateway-specific apt deps are installed here; protoc and the Rust toolchain
|
||||
# are delegated to the shared installer (the toolchain version is pinned by
|
||||
# sgl-model-gateway/rust-toolchain.toml, picked up automatically on first
|
||||
# `cargo` invocation).
|
||||
set -euxo pipefail
|
||||
|
||||
# Check if sudo is available
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
GATEWAY_APT_PACKAGES=(libssl-dev pkg-config redis-server)
|
||||
if command -v sudo >/dev/null 2>&1; then
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y libssl-dev pkg-config protobuf-compiler redis-server
|
||||
sudo apt-get install -y "${GATEWAY_APT_PACKAGES[@]}"
|
||||
else
|
||||
apt-get update
|
||||
apt-get install -y libssl-dev pkg-config protobuf-compiler redis-server
|
||||
apt-get install -y "${GATEWAY_APT_PACKAGES[@]}"
|
||||
fi
|
||||
|
||||
# Install rustup (Rust installer and version manager)
|
||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain 1.90
|
||||
bash "${SCRIPT_DIR}/../utils/install_rust_protoc.sh"
|
||||
|
||||
|
||||
# Follow the installation prompts, then reload your shell
|
||||
# Make cargo/rustc/protoc visible in this shell.
|
||||
. "$HOME/.cargo/env"
|
||||
source $HOME/.cargo/env
|
||||
|
||||
# Verify installation
|
||||
rustc --version
|
||||
cargo --version
|
||||
protoc --version
|
||||
|
||||
Reference in New Issue
Block a user