blob: 147fc7e8cb6e3f26f425a8d2f3c9bdf647ed1afe [file] [log] [blame]
Zhiyi Zhang8617a792017-01-17 16:45:56 -08001#!/usr/bin/env bash
Davide Pesavento552174c2020-04-16 01:54:08 -04002set -ex
Zhiyi Zhang8617a792017-01-17 16:45:56 -08003
4if has OSX $NODE_LABELS; then
Davide Pesaventocf9ffe42018-01-21 22:21:53 -05005 FORMULAE=(boost openssl pkg-config)
Davide Pesavento725d3fc2021-11-19 23:37:03 -05006 if [[ $JOB_NAME == *"Docs" ]]; then
7 FORMULAE+=(doxygen graphviz)
Davide Pesaventocf9ffe42018-01-21 22:21:53 -05008 fi
Zhiyi Zhang8617a792017-01-17 16:45:56 -08009
Davide Pesavento725d3fc2021-11-19 23:37:03 -050010 if [[ -n $GITHUB_ACTIONS ]]; then
11 # GitHub Actions runners have a large number of pre-installed
12 # Homebrew packages. Don't waste time upgrading all of them.
Davide Pesavento552174c2020-04-16 01:54:08 -040013 brew list --versions "${FORMULAE[@]}" || brew update
14 for FORMULA in "${FORMULAE[@]}"; do
15 brew list --versions "$FORMULA" || brew install "$FORMULA"
16 done
17 # Ensure /usr/local/opt/openssl exists
18 brew reinstall openssl
19 else
20 brew update
21 brew upgrade
22 brew install "${FORMULAE[@]}"
23 brew cleanup
24 fi
25
26elif has Ubuntu $NODE_LABELS; then
Zhiyi Zhang8617a792017-01-17 16:45:56 -080027 sudo apt-get -qq update
Davide Pesavento725d3fc2021-11-19 23:37:03 -050028 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Davide Pesavento552174c2020-04-16 01:54:08 -040029 libboost-all-dev libssl-dev libsqlite3-dev
Davide Pesaventocf9ffe42018-01-21 22:21:53 -050030
Davide Pesavento725d3fc2021-11-19 23:37:03 -050031 case $JOB_NAME in
32 *code-coverage)
33 sudo apt-get -qy install lcov python3-pip
Davide Pesavento9d6d4382022-04-19 17:26:03 -040034 pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.1'
Davide Pesavento725d3fc2021-11-19 23:37:03 -050035 ;;
36 *Docs)
37 sudo apt-get -qy install doxygen graphviz
38 ;;
39 esac
Davide Pesavento573a6212022-07-09 21:56:41 -040040
41elif has CentOS $NODE_LABELS; then
42 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
43 boost-devel openssl-devel sqlite-devel
Zhiyi Zhang8617a792017-01-17 16:45:56 -080044fi