Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 552174c | 2020-04-16 01:54:08 -0400 | [diff] [blame] | 2 | set -ex |
Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 3 | |
| 4 | if has OSX $NODE_LABELS; then |
Davide Pesavento | cf9ffe4 | 2018-01-21 22:21:53 -0500 | [diff] [blame] | 5 | FORMULAE=(boost openssl pkg-config) |
Davide Pesavento | 725d3fc | 2021-11-19 23:37:03 -0500 | [diff] [blame] | 6 | if [[ $JOB_NAME == *"Docs" ]]; then |
| 7 | FORMULAE+=(doxygen graphviz) |
Davide Pesavento | cf9ffe4 | 2018-01-21 22:21:53 -0500 | [diff] [blame] | 8 | fi |
Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 9 | |
Davide Pesavento | 725d3fc | 2021-11-19 23:37:03 -0500 | [diff] [blame] | 10 | 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 Pesavento | 552174c | 2020-04-16 01:54:08 -0400 | [diff] [blame] | 13 | 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 | |
| 26 | elif has Ubuntu $NODE_LABELS; then |
Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 27 | sudo apt-get -qq update |
Davide Pesavento | 725d3fc | 2021-11-19 23:37:03 -0500 | [diff] [blame] | 28 | sudo apt-get -qy install build-essential pkg-config python3-minimal \ |
Davide Pesavento | 552174c | 2020-04-16 01:54:08 -0400 | [diff] [blame] | 29 | libboost-all-dev libssl-dev libsqlite3-dev |
Davide Pesavento | cf9ffe4 | 2018-01-21 22:21:53 -0500 | [diff] [blame] | 30 | |
Davide Pesavento | 725d3fc | 2021-11-19 23:37:03 -0500 | [diff] [blame] | 31 | case $JOB_NAME in |
| 32 | *code-coverage) |
| 33 | sudo apt-get -qy install lcov python3-pip |
Davide Pesavento | 9d6d438 | 2022-04-19 17:26:03 -0400 | [diff] [blame] | 34 | pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.1' |
Davide Pesavento | 725d3fc | 2021-11-19 23:37:03 -0500 | [diff] [blame] | 35 | ;; |
| 36 | *Docs) |
| 37 | sudo apt-get -qy install doxygen graphviz |
| 38 | ;; |
| 39 | esac |
Davide Pesavento | 573a621 | 2022-07-09 21:56:41 -0400 | [diff] [blame^] | 40 | |
| 41 | elif has CentOS $NODE_LABELS; then |
| 42 | sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \ |
| 43 | boost-devel openssl-devel sqlite-devel |
Zhiyi Zhang | 8617a79 | 2017-01-17 16:45:56 -0800 | [diff] [blame] | 44 | fi |