Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 2 | set -ex |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 3 | |
Davide Pesavento | 0934888 | 2016-09-17 02:39:44 +0200 | [diff] [blame] | 4 | if has OSX $NODE_LABELS; then |
Davide Pesavento | 97242f7 | 2020-02-29 14:28:15 -0500 | [diff] [blame] | 5 | FORMULAE=(boost openssl pkg-config) |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 6 | if has OSX-10.13 $NODE_LABELS || has OSX-10.14 $NODE_LABELS; then |
| 7 | FORMULAE+=(python) |
Davide Pesavento | b1a2a4b | 2017-06-08 19:37:21 -0400 | [diff] [blame] | 8 | fi |
Davide Pesavento | 30ed628 | 2021-07-25 20:05:06 -0400 | [diff] [blame^] | 9 | if [[ $JOB_NAME == *"Docs" ]]; then |
| 10 | FORMULAE+=(doxygen graphviz) |
| 11 | fi |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 12 | |
Davide Pesavento | 30ed628 | 2021-07-25 20:05:06 -0400 | [diff] [blame^] | 13 | if [[ -n $GITHUB_ACTIONS || -n $TRAVIS ]]; then |
| 14 | # GitHub Actions and Travis images come with a large number of |
| 15 | # pre-installed packages. Don't waste time upgrading all of them. |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 16 | brew list --versions "${FORMULAE[@]}" || brew update |
| 17 | for FORMULA in "${FORMULAE[@]}"; do |
| 18 | brew list --versions "$FORMULA" || brew install "$FORMULA" |
| 19 | done |
| 20 | # Ensure /usr/local/opt/openssl exists |
| 21 | brew reinstall openssl |
| 22 | else |
| 23 | brew update |
| 24 | brew upgrade |
| 25 | brew install "${FORMULAE[@]}" |
| 26 | brew cleanup |
| 27 | fi |
Alexander Afanasyev | b346ddb | 2015-06-03 00:52:03 -0400 | [diff] [blame] | 28 | |
Davide Pesavento | 30ed628 | 2021-07-25 20:05:06 -0400 | [diff] [blame^] | 29 | if [[ $JOB_NAME == *"Docs" ]]; then |
| 30 | pip3 install --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink |
| 31 | fi |
| 32 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 33 | elif has Ubuntu $NODE_LABELS; then |
Davide Pesavento | e11c8d8 | 2016-04-16 14:32:07 +0200 | [diff] [blame] | 34 | sudo apt-get -qq update |
Davide Pesavento | 30ed628 | 2021-07-25 20:05:06 -0400 | [diff] [blame^] | 35 | sudo apt-get -qy install build-essential pkg-config python3-minimal \ |
Davide Pesavento | d776a93 | 2020-03-20 18:42:36 -0400 | [diff] [blame] | 36 | libboost-all-dev libssl-dev libsqlite3-dev |
Davide Pesavento | c44cc83 | 2017-04-03 22:11:48 -0400 | [diff] [blame] | 37 | |
Davide Pesavento | 30ed628 | 2021-07-25 20:05:06 -0400 | [diff] [blame^] | 38 | case $JOB_NAME in |
| 39 | *code-coverage) |
| 40 | sudo apt-get -qy install gcovr lcov |
| 41 | ;; |
| 42 | *Docs) |
| 43 | sudo apt-get -qy install doxygen graphviz python3-pip |
| 44 | pip3 install --user --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink |
| 45 | ;; |
| 46 | esac |
Md Ashiqur Rahman | 8bd3b8a | 2018-09-01 23:43:51 +0000 | [diff] [blame] | 47 | |
Davide Pesavento | 2349e28 | 2020-03-24 14:28:03 -0400 | [diff] [blame] | 48 | elif has CentOS-8 $NODE_LABELS; then |
| 49 | sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \ |
| 50 | boost-devel openssl-devel sqlite-devel |
Md Ashiqur Rahman | 8bd3b8a | 2018-09-01 23:43:51 +0000 | [diff] [blame] | 51 | fi |