Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 2 | set -eo pipefail |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 3 | |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -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+=(doxygen graphviz python3-pip) |
Davide Pesavento | 8dce194 | 2021-10-02 22:31:26 -0400 | [diff] [blame] | 15 | FORMULAE+=(doxygen graphviz) |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 16 | PIP_PKGS+=(sphinx sphinxcontrib-doxylink) |
| 17 | ;; |
| 18 | esac |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 19 | |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 20 | set -x |
| 21 | |
| 22 | if [[ $ID == macos ]]; then |
Davide Pesavento | 8dce194 | 2021-10-02 22:31:26 -0400 | [diff] [blame] | 23 | if [[ -n $GITHUB_ACTIONS ]]; then |
Davide Pesavento | 36651f1 | 2023-01-02 17:07:21 -0500 | [diff] [blame^] | 24 | export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 25 | fi |
| 26 | brew update |
| 27 | brew install --formula "${FORMULAE[@]}" |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 28 | elif [[ $ID_LIKE == *debian* ]]; then |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 29 | sudo apt-get -qq update |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 30 | sudo apt-get -qy install "${APT_PKGS[@]}" |
Davide Pesavento | da1a4d3 | 2022-08-19 19:03:24 -0400 | [diff] [blame] | 31 | elif [[ $ID_LIKE == *fedora* ]]; then |
Davide Pesavento | b68f284 | 2022-11-17 19:07:04 -0500 | [diff] [blame] | 32 | sudo dnf -y install gcc-c++ libasan lld pkgconf-pkg-config python3 \ |
Davide Pesavento | f278438 | 2022-07-09 19:58:53 -0400 | [diff] [blame] | 33 | boost-devel openssl-devel sqlite-devel |
Ashlesh Gawande | 0b2897e | 2018-06-20 14:40:47 -0500 | [diff] [blame] | 34 | fi |
Davide Pesavento | b68f284 | 2022-11-17 19:07:04 -0500 | [diff] [blame] | 35 | |
| 36 | if (( ${#PIP_PKGS[@]} )); then |
| 37 | pip3 install --user --upgrade --upgrade-strategy=eager "${PIP_PKGS[@]}" |
| 38 | fi |