blob: 95dfe3764619f77110e10624f487a3ab5e6b9133 [file] [log] [blame]
Davide Pesavento0bd37312017-08-20 20:21:13 -04001#!/usr/bin/env bash
Davide Pesaventof6be8e32020-04-30 16:06:03 -04002set -ex
Davide Pesavento0bd37312017-08-20 20:21:13 -04003
4if has OSX $NODE_LABELS; then
Davide Pesavento0b0eddd2019-03-19 14:42:15 -04005 FORMULAE=(boost openssl pkg-config)
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -04006 if [[ $JOB_NAME == *"Docs" ]]; then
7 FORMULAE+=(doxygen graphviz)
Davide Pesavento0bd37312017-08-20 20:21:13 -04008 fi
Davide Pesavento0bd37312017-08-20 20:21:13 -04009
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -040010 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 Pesaventof6be8e32020-04-30 16:06:03 -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
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -040026 if [[ $JOB_NAME == *"Docs" ]]; then
27 pip3 install --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink
28 fi
29
Davide Pesaventof6be8e32020-04-30 16:06:03 -040030elif has Ubuntu $NODE_LABELS; then
Davide Pesavento0bd37312017-08-20 20:21:13 -040031 sudo apt-get -qq update
Davide Pesavento4a90b9a2020-08-07 17:44:33 -040032 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Davide Pesaventof6be8e32020-04-30 16:06:03 -040033 libboost-all-dev libssl-dev libsqlite3-dev
Davide Pesavento0bd37312017-08-20 20:21:13 -040034
Davide Pesaventoba8a4ed2021-10-13 21:28:43 -040035 case $JOB_NAME in
36 *code-coverage)
37 sudo apt-get -qy install lcov python3-pip
38 pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.0'
39 ;;
40 *Docs)
41 sudo apt-get -qy install doxygen graphviz python3-pip
42 pip3 install --user --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink
43 ;;
44 esac
Davide Pesavento0bd37312017-08-20 20:21:13 -040045fi