Alexander Afanasyev | b81cff9 | 2015-07-09 09:45:09 +0800 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 2 | set -ex |
Alexander Afanasyev | b81cff9 | 2015-07-09 09:45:09 +0800 | [diff] [blame] | 3 | |
Davide Pesavento | e0edc4c | 2016-09-13 18:29:52 +0000 | [diff] [blame] | 4 | if has OSX $NODE_LABELS; then |
Davide Pesavento | c25737c | 2017-08-26 13:18:17 -0400 | [diff] [blame] | 5 | FORMULAE=(boost openssl pkg-config) |
Davide Pesavento | 8f0028d | 2021-07-27 20:01:06 -0400 | [diff] [blame] | 6 | if [[ $JOB_NAME == *"Docs" ]]; then |
| 7 | FORMULAE+=(doxygen graphviz) |
| 8 | fi |
Alexander Afanasyev | b81cff9 | 2015-07-09 09:45:09 +0800 | [diff] [blame] | 9 | |
Davide Pesavento | f28a061 | 2021-09-29 23:13:32 -0400 | [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 | 69857c3 | 2020-04-05 16:36:26 -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 | |
Davide Pesavento | 8f0028d | 2021-07-27 20:01:06 -0400 | [diff] [blame] | 26 | if [[ $JOB_NAME == *"Docs" ]]; then |
| 27 | pip3 install --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink |
| 28 | fi |
| 29 | |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 30 | elif has Ubuntu $NODE_LABELS; then |
Davide Pesavento | cc7bee7 | 2016-04-22 02:21:13 +0200 | [diff] [blame] | 31 | sudo apt-get -qq update |
Davide Pesavento | b7e72c3 | 2020-10-02 20:00:03 -0400 | [diff] [blame] | 32 | sudo apt-get -qy install build-essential pkg-config python3-minimal \ |
Davide Pesavento | 69857c3 | 2020-04-05 16:36:26 -0400 | [diff] [blame] | 33 | libboost-all-dev libssl-dev libsqlite3-dev \ |
| 34 | libpcap-dev libsystemd-dev |
Davide Pesavento | 8d61c03 | 2017-04-29 20:06:33 -0400 | [diff] [blame] | 35 | |
Davide Pesavento | 8f0028d | 2021-07-27 20:01:06 -0400 | [diff] [blame] | 36 | case $JOB_NAME in |
| 37 | *code-coverage) |
Davide Pesavento | 2c61bad | 2021-08-30 22:40:35 -0400 | [diff] [blame] | 38 | sudo apt-get -qy install lcov python3-pip |
Davide Pesavento | 6153eaf | 2022-04-19 19:45:03 -0400 | [diff] [blame^] | 39 | pip3 install --user --upgrade --upgrade-strategy=eager 'gcovr~=5.1' |
Davide Pesavento | 8f0028d | 2021-07-27 20:01:06 -0400 | [diff] [blame] | 40 | ;; |
| 41 | *Docs) |
| 42 | sudo apt-get -qy install doxygen graphviz python3-pip |
| 43 | pip3 install --user --upgrade --upgrade-strategy=eager sphinx sphinxcontrib-doxylink |
| 44 | ;; |
| 45 | esac |
Md Ashiqur Rahman | 922330b | 2018-09-04 17:55:18 +0000 | [diff] [blame] | 46 | |
Davide Pesavento | 8f290fc | 2020-04-12 13:20:07 -0400 | [diff] [blame] | 47 | elif has CentOS-8 $NODE_LABELS; then |
Davide Pesavento | 9ab43e6 | 2020-12-27 20:07:25 -0500 | [diff] [blame] | 48 | sudo dnf config-manager --enable powertools |
Davide Pesavento | 8f290fc | 2020-04-12 13:20:07 -0400 | [diff] [blame] | 49 | sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \ |
| 50 | boost-devel openssl-devel sqlite-devel \ |
| 51 | libpcap-devel systemd-devel |
Md Ashiqur Rahman | 922330b | 2018-09-04 17:55:18 +0000 | [diff] [blame] | 52 | fi |