39 lines
1.2 KiB
Bash
Executable file
39 lines
1.2 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
# Reproducible Ubuntu setup for Site jobs. Rustup must already be provisioned
|
|
# on the runner; CI does not curl an unverified installer into a shell.
|
|
set -euo pipefail
|
|
|
|
[[ $(uname -s) == Linux ]] || {
|
|
echo "ci-setup-ubuntu.sh only supports Linux runners" >&2
|
|
exit 1
|
|
}
|
|
command -v rustup >/dev/null || {
|
|
echo "ERROR: runner must provide rustup; refusing unverified bootstrap" >&2
|
|
exit 1
|
|
}
|
|
|
|
packages=(
|
|
time pkg-config
|
|
libwayland-dev libxcursor-dev libxrandr-dev libxi-dev libx11-dev
|
|
libgl1-mesa-dev libasound2-dev libglib2.0-dev libssl-dev
|
|
libsqlite3-dev libudev-dev libpulse-dev libxkbcommon-dev libdbus-1-dev
|
|
xvfb xdotool imagemagick
|
|
)
|
|
if [[ ${NIGIG_SITE_INSTALL_NATIVE_KEYRING:-0} == 1 ]]; then
|
|
packages+=(dbus-x11 gnome-keyring libsecret-tools)
|
|
fi
|
|
sudo apt-get update -qq
|
|
sudo apt-get install -y -qq "${packages[@]}"
|
|
|
|
channel=$(sed -n \
|
|
's/^[[:space:]]*channel[[:space:]]*=[[:space:]]*"\([^"]*\)".*/\1/p' \
|
|
rust-toolchain.toml | head -n 1)
|
|
[[ -n $channel ]] || {
|
|
echo "ERROR: rust-toolchain.toml has no channel" >&2
|
|
exit 1
|
|
}
|
|
|
|
rustup toolchain install "$channel" --profile minimal --component rustfmt --component clippy
|
|
rustup default "$channel"
|
|
rustc --version
|
|
cargo --version
|