Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame^] | 2 | set -eo pipefail |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 3 | |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame^] | 4 | APT_PKGS=(build-essential pkg-config python3-minimal |
| 5 | libboost-all-dev libssl-dev libsqlite3-dev) |
| 6 | FORMULAE=(boost openssl pkg-config) |
| 7 | PIP_PKGS=() |
| 8 | case $JOB_NAME in |
| 9 | *code-coverage) |
| 10 | APT_PKGS+=(lcov python3-pip) |
| 11 | PIP_PKGS+=('gcovr~=5.2') |
| 12 | ;; |
| 13 | *Docs) |
| 14 | APT_PKGS+=(python3-pip) |
| 15 | PIP_PKGS+=(sphinx) |
| 16 | ;; |
| 17 | esac |
Davide Pesavento | 4a16004 | 2020-04-13 16:50:02 -0400 | [diff] [blame] | 18 | |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame^] | 19 | set -x |
| 20 | |
| 21 | if [[ $ID == macos ]]; then |
Davide Pesavento | 333e3eb | 2021-10-12 19:30:51 -0400 | [diff] [blame] | 22 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame^] | 23 | export HOMEBREW_NO_INSTALL_UPGRADE=1 |
| 24 | fi |
| 25 | brew update |
| 26 | brew install --formula "${FORMULAE[@]}" |
| 27 | |
| 28 | if (( ${#PIP_PKGS[@]} )); then |
| 29 | pip3 install --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 30 | fi |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 31 | |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame^] | 32 | elif [[ $ID_LIKE == *debian* ]]; then |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 33 | sudo apt-get -qq update |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame^] | 34 | sudo apt-get -qy install "${APT_PKGS[@]}" |
Davide Pesavento | 333e3eb | 2021-10-12 19:30:51 -0400 | [diff] [blame] | 35 | |
Davide Pesavento | 1d48453 | 2022-08-19 22:08:31 -0400 | [diff] [blame^] | 36 | if (( ${#PIP_PKGS[@]} )); then |
| 37 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 38 | fi |
| 39 | |
| 40 | elif [[ $ID_LIKE == *fedora* ]]; then |
| 41 | sudo dnf -y install gcc-c++ libasan pkgconf-pkg-config python3 \ |
| 42 | boost-devel openssl-devel sqlite-devel |
Alexander Afanasyev | f34a355 | 2017-08-13 21:17:05 -0400 | [diff] [blame] | 43 | fi |