test: get 32-bit Ubuntu 22.04 build working
[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
ce1b5612 26 libnuma-dev
dff32ddb 27 libnfs-dev
ce1b5612
SW
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 )
39 ;;
40 "x86_64")
41 pkgs+=(
42 libglusterfs-dev
43 libgoogle-perftools-dev
44 libiscsi-dev
45 libnbd-dev
46 libpmem-dev
47 libpmemblk-dev
48 librbd-dev
49 libtcmalloc-minimal4
50 nvidia-cuda-dev
b68ba328
VF
51 libibverbs-dev
52 librdmacm-dev
ce1b5612 53 )
726a9585
VF
54 echo "Removing libunwind-14-dev because of conflicts with libunwind-dev"
55 sudo apt remove -y libunwind-14-dev
ce1b5612
SW
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
b68ba328
VF
68 echo "Installing packages... ${pkgs[@]}"
69 sudo apt-get install -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..."
dff32ddb 81 HOMEBREW_NO_AUTO_UPDATE=1 brew install cunit libnfs
5c997f9c 82 pip3 install scipy six sphinx
ce1b5612
SW
83}
84
85main() {
787c02a6
BVA
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
ce1b5612
SW
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
102main