ci/travis-*: Fix shellcheck warnings
[fio.git] / ci / actions-install.sh
CommitLineData
ce1b5612
SW
1#!/bin/bash
2# This script expects to be invoked from the base fio directory.
3set -eu
4
5SCRIPT_DIR=$(dirname "$0")
6# shellcheck disable=SC1091
7. "${SCRIPT_DIR}/common.sh"
8
9install_ubuntu() {
10 local pkgs
11
12 cat <<DPKGCFG | sudo tee /etc/dpkg/dpkg.cfg.d/dpkg-speedup > /dev/null
13# Skip fsync
14force-unsafe-io
15# Don't install documentation
16path-exclude=/usr/share/man/*
17path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo
18path-exclude=/usr/share/doc/*
19DPKGCFG
20 # Packages available on i686 and x86_64
21 pkgs=(
22 libaio-dev
23 libcunit1-dev
24 libcurl4-openssl-dev
25 libfl-dev
26 libibverbs-dev
27 libnuma-dev
28 librdmacm-dev
29 valgrind
30 )
31 case "${CI_TARGET_ARCH}" in
32 "i686")
33 sudo dpkg --add-architecture i386
1420399f 34 opts="--allow-downgrades"
ce1b5612
SW
35 pkgs=("${pkgs[@]/%/:i386}")
36 pkgs+=(
37 gcc-multilib
38 pkg-config:i386
39 zlib1g-dev:i386
1420399f 40 libpcre2-8-0=10.34-7
ce1b5612
SW
41 )
42 ;;
43 "x86_64")
1420399f 44 opts=""
ce1b5612
SW
45 pkgs+=(
46 libglusterfs-dev
47 libgoogle-perftools-dev
48 libiscsi-dev
49 libnbd-dev
50 libpmem-dev
51 libpmemblk-dev
52 librbd-dev
53 libtcmalloc-minimal4
54 nvidia-cuda-dev
55 )
56 ;;
57 esac
58
59 # Architecture-independent packages and packages for which we don't
60 # care about the architecture.
61 pkgs+=(
62 python3-scipy
5c997f9c 63 python3-sphinx
ce1b5612
SW
64 )
65
66 echo "Updating APT..."
67 sudo apt-get -qq update
68 echo "Installing packages..."
1420399f 69 sudo apt-get install "$opts" -o APT::Immediate-Configure=false --no-install-recommends -qq -y "${pkgs[@]}"
ce1b5612
SW
70}
71
72install_linux() {
73 install_ubuntu
74}
75
76install_macos() {
77 # Assumes homebrew and python3 are already installed
78 #echo "Updating homebrew..."
79 #brew update >/dev/null 2>&1
80 echo "Installing packages..."
81 HOMEBREW_NO_AUTO_UPDATE=1 brew install cunit
5c997f9c 82 pip3 install scipy six sphinx
ce1b5612
SW
83}
84
85main() {
86 set_ci_target_os
87
88 install_function="install_${CI_TARGET_OS}"
89 ${install_function}
90
91 echo "Python3 path: $(type -p python3 2>&1)"
92 echo "Python3 version: $(python3 -V 2>&1)"
93}
94
95main