t/nvmept_trim: increase transfer size for some tests
[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         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
34             opts="--allow-downgrades"
35             pkgs=("${pkgs[@]/%/:i386}")
36             pkgs+=(
37                 gcc-multilib
38                 pkg-config:i386
39                 zlib1g-dev:i386
40                 libpcre2-8-0=10.34-7
41             )
42             ;;
43         "x86_64")
44             opts=""
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
63         python3-sphinx
64     )
65
66     echo "Updating APT..."
67     sudo apt-get -qq update
68     echo "Installing packages..."
69     sudo apt-get install "$opts" -o APT::Immediate-Configure=false --no-install-recommends -qq -y "${pkgs[@]}"
70 }
71
72 install_linux() {
73     install_ubuntu
74 }
75
76 install_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
82     pip3 install scipy six sphinx
83 }
84
85 main() {
86     if [ "${CI_TARGET_BUILD}" = "android" ]; then
87         echo "Installing Android NDK..."
88         wget --quiet https://dl.google.com/android/repository/android-ndk-r24-linux.zip
89         unzip -q android-ndk-r24-linux.zip
90         return 0
91     fi
92
93     set_ci_target_os
94
95     install_function="install_${CI_TARGET_OS}"
96     ${install_function}
97
98     echo "Python3 path: $(type -p python3 2>&1)"
99     echo "Python3 version: $(python3 -V 2>&1)"
100 }
101
102 main