blob: 95dfe3764619f77110e10624f487a3ab5e6b9133 [file] [log] [blame]
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07001#!/usr/bin/env bash
Davide Pesaventofee7ee32020-04-15 02:45:07 -04002set -ex
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07003
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -08004if has OSX $NODE_LABELS; then
Davide Pesavento4a315b32018-11-24 14:32:19 -05005 FORMULAE=(boost openssl pkg-config)
Davide Pesavento90a632b2021-10-04 01:05:24 -04006 if [[ $JOB_NAME == *"Docs" ]]; then
7 FORMULAE+=(doxygen graphviz)
Davide Pesavento4a315b32018-11-24 14:32:19 -05008 fi
Alexander Afanasyevc7c99002015-10-09 17:27:30 -07009
Davide Pesavento90a632b2021-10-04 01:05:24 -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 Pesaventofee7ee32020-04-15 02:45:07 -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 Pesavento90a632b2021-10-04 01:05:24 -040026 if [[ $JOB_NAME == *"Docs" ]]; then
27 pip3 install --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink
28 fi
29
Davide Pesaventofee7ee32020-04-15 02:45:07 -040030elif has Ubuntu $NODE_LABELS; then
Alexander Afanasyev984ca9d2016-12-19 13:09:14 -080031 sudo apt-get -qq update
Davide Pesaventobdd88c12020-11-26 00:35:08 -050032 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Davide Pesaventofee7ee32020-04-15 02:45:07 -040033 libboost-all-dev libssl-dev libsqlite3-dev
Davide Pesavento4a315b32018-11-24 14:32:19 -050034
Davide Pesavento90a632b2021-10-04 01:05:24 -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
Alexander Afanasyevc7c99002015-10-09 17:27:30 -070045fi