blob: d3b16f924553f74bb169c0a488cd27f0aa01f1d5 [file] [log] [blame]
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04001#!/usr/bin/env bash
Davide Pesaventoec61b742020-04-18 01:00:12 -04002set -ex
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04003
4if has OSX $NODE_LABELS; then
5 FORMULAE=(boost openssl pkg-config)
Davide Pesavento3c7f6452021-10-02 04:06:26 -04006 if [[ $JOB_NAME == *"Docs" ]]; then
7 FORMULAE+=(doxygen graphviz)
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04008 fi
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -04009
Davide Pesavento3c7f6452021-10-02 04:06: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 Pesaventoec61b742020-04-18 01:00:12 -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 Pesavento3c7f6452021-10-02 04:06:26 -040026 if [[ $JOB_NAME == *"Docs" ]]; then
27 pip3 install --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink
28 fi
29
Davide Pesaventoec61b742020-04-18 01:00:12 -040030elif has Ubuntu $NODE_LABELS; then
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040031 sudo apt-get -qq update
Davide Pesaventoba3f6892020-12-08 22:18:35 -050032 sudo apt-get -qy install build-essential pkg-config python3-minimal \
Davide Pesaventoec61b742020-04-18 01:00:12 -040033 libboost-all-dev libssl-dev libsqlite3-dev
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040034
Davide Pesavento3c7f6452021-10-02 04:06:26 -040035 case $JOB_NAME in
36 *code-coverage)
37 sudo apt-get -qy install lcov python3-pip
Davide Pesaventobde084f2022-04-17 00:21:35 -040038 pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.1'
Davide Pesavento3c7f6452021-10-02 04:06: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
Davide Pesavento7e7bd892022-07-10 00:30:06 -040045
46elif has CentOS $NODE_LABELS; then
47 sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \
48 boost-devel openssl-devel sqlite-devel
Alexander Afanasyev6e64ac92018-06-14 17:25:38 -040049fi