blob: a28711607a0a684ff04f1b982a1505426ca8cef7 [file] [log] [blame]
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05001#!/usr/bin/env bash
Davide Pesavento133067f2020-04-02 22:08:27 -04002set -ex
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05003
4if has OSX $NODE_LABELS; then
5 FORMULAE=(boost openssl pkg-config)
Davide Pesavento8dce1942021-10-02 22:31:26 -04006 if [[ $JOB_NAME == *"Docs" ]]; then
7 FORMULAE+=(doxygen graphviz)
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05008 fi
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -05009
Davide Pesavento8dce1942021-10-02 22:31:26 -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 Pesavento133067f2020-04-02 22:08:27 -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 Pesavento8dce1942021-10-02 22:31:26 -040026 if [[ $JOB_NAME == *"Docs" ]]; then
27 pip3 install --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink
28 fi
29
Davide Pesavento133067f2020-04-02 22:08:27 -040030elif has Ubuntu $NODE_LABELS; then
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050031 sudo apt-get -qq update
Davide Pesavento042dfb32020-07-23 21:07:16 -040032 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Davide Pesavento133067f2020-04-02 22:08:27 -040033 libboost-all-dev libssl-dev libsqlite3-dev
Davide Pesavento87d4e202020-08-09 01:18:52 -040034
Davide Pesavento8dce1942021-10-02 22:31:26 -040035 case $JOB_NAME in
36 *code-coverage)
37 sudo apt-get -qy install lcov python3-pip
Davide Pesavento0ba5eb62022-04-19 18:05:16 -040038 pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.1'
Davide Pesavento8dce1942021-10-02 22:31:26 -040039 ;;
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
Ashlesh Gawande0b2897e2018-06-20 14:40:47 -050045fi