blob: 31b89ee81426190ecd702932113b1d2b8ead3379 [file] [log] [blame]
Junxiao Shi439d9722015-03-20 15:08:44 -07001#!/usr/bin/env bash
Davide Pesaventod8398822020-03-29 18:46:19 -04002set -ex
Davide Pesavento956ac312016-09-20 19:11:30 +02003
Junxiao Shi439d9722015-03-20 15:08:44 -07004if has OSX $NODE_LABELS; then
Davide Pesavento07238e82017-08-26 13:21:57 -04005 FORMULAE=(boost openssl pkg-config)
Junxiao Shi439d9722015-03-20 15:08:44 -07006
Davide Pesavento2c8ec072021-09-30 00:04:23 -04007 if [[ -n $GITHUB_ACTIONS ]]; then
8 # GitHub Actions runners have a large number of pre-installed
9 # Homebrew packages. Don't waste time upgrading all of them.
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040010 brew list --versions "${FORMULAE[@]}" || brew update
11 for FORMULA in "${FORMULAE[@]}"; do
12 brew list --versions "$FORMULA" || brew install "$FORMULA"
13 done
14 # Ensure /usr/local/opt/openssl exists
15 brew reinstall openssl
16 else
17 brew update
18 brew upgrade
19 brew install "${FORMULAE[@]}"
20 brew cleanup
21 fi
22
Davide Pesaventoe8c82ef2021-07-28 02:38:51 -040023 if [[ $JOB_NAME == *"Docs" ]]; then
24 pip3 install --upgrade --upgrade-strategy=eager sphinx
25 fi
26
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040027elif has Ubuntu $NODE_LABELS; then
Davide Pesavento0e8edde2016-05-03 18:08:39 +020028 sudo apt-get -qq update
Davide Pesavento02ec47c2020-08-09 02:23:07 -040029 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Davide Pesaventoa1a9d702020-03-29 00:58:15 -040030 libboost-all-dev libssl-dev libsqlite3-dev \
31 libpcap-dev
Davide Pesavento931dfe82017-04-29 20:33:45 -040032
Davide Pesaventoe8c82ef2021-07-28 02:38:51 -040033 case $JOB_NAME in
34 *code-coverage)
Davide Pesavento8c353902021-08-30 19:10:36 -040035 sudo apt-get -qy install lcov python3-pip
36 pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.0'
Davide Pesaventoe8c82ef2021-07-28 02:38:51 -040037 ;;
38 *Docs)
39 sudo apt-get -qy install python3-pip
40 pip3 install --user --upgrade --upgrade-strategy=eager sphinx
41 ;;
42 esac
Md Ashiqur Rahman25c37f12018-10-12 17:59:20 +000043
Davide Pesaventod8398822020-03-29 18:46:19 -040044elif has CentOS-8 $NODE_LABELS; then
Davide Pesavento3047ba42020-12-27 20:00:06 -050045 sudo dnf config-manager --enable powertools
Davide Pesaventod8398822020-03-29 18:46:19 -040046 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
47 boost-devel openssl-devel sqlite-devel \
48 libpcap-devel
Md Ashiqur Rahman25c37f12018-10-12 17:59:20 +000049fi