blob: 95dfe3764619f77110e10624f487a3ab5e6b9133 [file] [log] [blame]
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04001#!/usr/bin/env bash
Davide Pesavento4a160042020-04-13 16:50:02 -04002set -ex
Alexander Afanasyevf34a3552017-08-13 21:17:05 -04003
4if has OSX $NODE_LABELS; then
Davide Pesaventob545aac2017-09-22 23:54:10 -04005 FORMULAE=(boost openssl pkg-config)
Davide Pesavento333e3eb2021-10-12 19:30:51 -04006 if [[ $JOB_NAME == *"Docs" ]]; then
7 FORMULAE+=(doxygen graphviz)
Davide Pesavento4a160042020-04-13 16:50:02 -04008 fi
9
Davide Pesavento333e3eb2021-10-12 19:30:51 -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 Pesavento4a160042020-04-13 16:50:02 -040013 brew list --versions "${FORMULAE[@]}" || brew update
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040014 for FORMULA in "${FORMULAE[@]}"; do
Davide Pesavento4a160042020-04-13 16:50:02 -040015 brew list --versions "$FORMULA" || brew install "$FORMULA"
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040016 done
Davide Pesavento4a160042020-04-13 16:50:02 -040017 # Ensure /usr/local/opt/openssl exists
18 brew reinstall openssl
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040019 else
Davide Pesavento4a160042020-04-13 16:50:02 -040020 brew update
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040021 brew upgrade
Davide Pesavento4a160042020-04-13 16:50:02 -040022 brew install "${FORMULAE[@]}"
23 brew cleanup
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040024 fi
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040025
Davide Pesavento333e3eb2021-10-12 19:30:51 -040026 if [[ $JOB_NAME == *"Docs" ]]; then
27 pip3 install --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink
28 fi
29
Davide Pesavento4a160042020-04-13 16:50:02 -040030elif has Ubuntu $NODE_LABELS; then
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040031 sudo apt-get -qq update
Davide Pesavento6df68802021-06-04 14:01:36 -040032 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Davide Pesavento4a160042020-04-13 16:50:02 -040033 libboost-all-dev libssl-dev libsqlite3-dev
Davide Pesavento333e3eb2021-10-12 19:30:51 -040034
35 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
Alexander Afanasyevf34a3552017-08-13 21:17:05 -040045fi