Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | d839882 | 2020-03-29 18:46:19 -0400 | [diff] [blame] | 2 | set -ex |
Davide Pesavento | 956ac31 | 2016-09-20 19:11:30 +0200 | [diff] [blame] | 3 | |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 4 | if has OSX $NODE_LABELS; then |
Davide Pesavento | 07238e8 | 2017-08-26 13:21:57 -0400 | [diff] [blame] | 5 | FORMULAE=(boost openssl pkg-config) |
Junxiao Shi | 439d972 | 2015-03-20 15:08:44 -0700 | [diff] [blame] | 6 | |
Davide Pesavento | 2c8ec07 | 2021-09-30 00:04:23 -0400 | [diff] [blame^] | 7 | if [[ -n $GITHUB_ACTIONS ]]; then |
| 8 | # GitHub Actions runners have a large number of pre-installed |
| 9 | # Homebrew packages. Don't waste time upgrading all of them. |
Davide Pesavento | a1a9d70 | 2020-03-29 00:58:15 -0400 | [diff] [blame] | 10 | brew list --versions "${FORMULAE[@]}" || brew update |
| 11 | for FORMULA in "${FORMULAE[@]}"; do |
| 12 | brew list --versions "$FORMULA" || brew install "$FORMULA" |
| 13 | done |
| 14 | # Ensure /usr/local/opt/openssl exists |
| 15 | brew reinstall openssl |
| 16 | else |
| 17 | brew update |
| 18 | brew upgrade |
| 19 | brew install "${FORMULAE[@]}" |
| 20 | brew cleanup |
| 21 | fi |
| 22 | |
Davide Pesavento | e8c82ef | 2021-07-28 02:38:51 -0400 | [diff] [blame] | 23 | if [[ $JOB_NAME == *"Docs" ]]; then |
| 24 | pip3 install --upgrade --upgrade-strategy=eager sphinx |
| 25 | fi |
| 26 | |
Davide Pesavento | a1a9d70 | 2020-03-29 00:58:15 -0400 | [diff] [blame] | 27 | elif has Ubuntu $NODE_LABELS; then |
Davide Pesavento | 0e8edde | 2016-05-03 18:08:39 +0200 | [diff] [blame] | 28 | sudo apt-get -qq update |
Davide Pesavento | 02ec47c | 2020-08-09 02:23:07 -0400 | [diff] [blame] | 29 | sudo apt-get -qy install build-essential pkg-config python3-minimal \ |
Davide Pesavento | a1a9d70 | 2020-03-29 00:58:15 -0400 | [diff] [blame] | 30 | libboost-all-dev libssl-dev libsqlite3-dev \ |
| 31 | libpcap-dev |
Davide Pesavento | 931dfe8 | 2017-04-29 20:33:45 -0400 | [diff] [blame] | 32 | |
Davide Pesavento | e8c82ef | 2021-07-28 02:38:51 -0400 | [diff] [blame] | 33 | case $JOB_NAME in |
| 34 | *code-coverage) |
Davide Pesavento | 8c35390 | 2021-08-30 19:10:36 -0400 | [diff] [blame] | 35 | sudo apt-get -qy install lcov python3-pip |
| 36 | pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.0' |
Davide Pesavento | e8c82ef | 2021-07-28 02:38:51 -0400 | [diff] [blame] | 37 | ;; |
| 38 | *Docs) |
| 39 | sudo apt-get -qy install python3-pip |
| 40 | pip3 install --user --upgrade --upgrade-strategy=eager sphinx |
| 41 | ;; |
| 42 | esac |
Md Ashiqur Rahman | 25c37f1 | 2018-10-12 17:59:20 +0000 | [diff] [blame] | 43 | |
Davide Pesavento | d839882 | 2020-03-29 18:46:19 -0400 | [diff] [blame] | 44 | elif has CentOS-8 $NODE_LABELS; then |
Davide Pesavento | 3047ba4 | 2020-12-27 20:00:06 -0500 | [diff] [blame] | 45 | sudo dnf config-manager --enable powertools |
Davide Pesavento | d839882 | 2020-03-29 18:46:19 -0400 | [diff] [blame] | 46 | sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \ |
| 47 | boost-devel openssl-devel sqlite-devel \ |
| 48 | libpcap-devel |
Md Ashiqur Rahman | 25c37f1 | 2018-10-12 17:59:20 +0000 | [diff] [blame] | 49 | fi |