t/zbd: avoid test case 31 failure with small devices
[fio.git] / ci / actions-install.sh
1 #!/bin/bash
2 # This script expects to be invoked from the base fio directory.
3 set -eu
4
5 SCRIPT_DIR=$(dirname "$0")
6 # shellcheck disable=SC1091
7 . "${SCRIPT_DIR}/common.sh"
8
9 install_ubuntu() {
10     local pkgs
11
12     cat <<DPKGCFG | sudo tee /etc/dpkg/dpkg.cfg.d/dpkg-speedup > /dev/null
13 # Skip fsync
14 force-unsafe-io
15 # Don't install documentation
16 path-exclude=/usr/share/man/*
17 path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo
18 path-exclude=/usr/share/doc/*
19 DPKGCFG
20     # Packages available on i686 and x86_64
21     pkgs=(
22         libaio-dev
23         libcunit1-dev
24         libcurl4-openssl-dev
25         libfl-dev
26         libnuma-dev
27         libnfs-dev
28         valgrind
29     )
30     case "${CI_TARGET_ARCH}" in
31         "i686")
32             sudo dpkg --add-architecture i386
33             pkgs=("${pkgs[@]/%/:i386}")
34             pkgs+=(
35                 gcc-multilib
36                 pkg-config:i386
37                 zlib1g-dev:i386
38                 libc6:i386
39                 libgcc-s1:i386
40             )
41             ;;
42         "x86_64")
43             pkgs+=(
44                 libglusterfs-dev
45                 libgoogle-perftools-dev
46                 libiscsi-dev
47                 libnbd-dev
48                 libpmem-dev
49                 libpmem2-dev
50                 libprotobuf-c-dev
51                 librbd-dev
52                 libtcmalloc-minimal4
53                 nvidia-cuda-dev
54                 libibverbs-dev
55                 librdmacm-dev
56             )
57             echo "Removing libunwind-14-dev because of conflicts with libunwind-dev"
58             sudo apt remove -y libunwind-14-dev
59             ;;
60     esac
61
62     # Architecture-independent packages and packages for which we don't
63     # care about the architecture.
64     pkgs+=(
65         python3-scipy
66         python3-sphinx
67         python3-statsmodels
68     )
69
70     echo "Updating APT..."
71     sudo apt-get -qq update
72     echo "Installing packages... ${pkgs[@]}"
73     sudo apt-get install -o APT::Immediate-Configure=false --no-install-recommends -qq -y "${pkgs[@]}"
74     if [ "${CI_TARGET_ARCH}" == "x86_64" ]; then
75         # install librpma from sources
76         ci/actions-install-librpma.sh
77     fi
78 }
79
80 install_linux() {
81     install_ubuntu
82 }
83
84 install_macos() {
85     # Assumes homebrew and python3 are already installed
86     #echo "Updating homebrew..."
87     #brew update >/dev/null 2>&1
88     echo "Installing packages..."
89     HOMEBREW_NO_AUTO_UPDATE=1 brew install cunit libnfs
90     pip3 install scipy six statsmodels sphinx
91 }
92
93 install_windows() {
94         pip3 install scipy six statsmodels sphinx
95 }
96
97 main() {
98     case "${CI_TARGET_BUILD}" in
99         android*)
100             echo "Installing Android NDK..."
101             wget --quiet https://dl.google.com/android/repository/android-ndk-r24-linux.zip
102             unzip -q android-ndk-r24-linux.zip
103             return 0
104             ;;
105     esac
106
107     set_ci_target_os
108
109     install_function="install_${CI_TARGET_OS}"
110     ${install_function}
111
112     echo "Python3 path: $(type -p python3 2>&1)"
113     echo "Python3 version: $(python3 -V 2>&1)"
114 }
115
116 main