test: use Ubuntu 22.04 for 64-bit tests
[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
dff32ddb 29 libnfs-dev
ce1b5612
SW
30 valgrind
31 )
32 case "${CI_TARGET_ARCH}" in
33 "i686")
34 sudo dpkg --add-architecture i386
1420399f 35 opts="--allow-downgrades"
ce1b5612
SW
36 pkgs=("${pkgs[@]/%/:i386}")
37 pkgs+=(
38 gcc-multilib
39 pkg-config:i386
40 zlib1g-dev:i386
1420399f 41 libpcre2-8-0=10.34-7
ce1b5612
SW
42 )
43 ;;
44 "x86_64")
1420399f 45 opts=""
ce1b5612
SW
46 pkgs+=(
47 libglusterfs-dev
48 libgoogle-perftools-dev
49 libiscsi-dev
50 libnbd-dev
51 libpmem-dev
52 libpmemblk-dev
53 librbd-dev
54 libtcmalloc-minimal4
55 nvidia-cuda-dev
56 )
726a9585
VF
57 echo "Removing libunwind-14-dev because of conflicts with libunwind-dev"
58 sudo apt remove -y libunwind-14-dev
ce1b5612
SW
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
5c997f9c 66 python3-sphinx
ce1b5612
SW
67 )
68
69 echo "Updating APT..."
70 sudo apt-get -qq update
71 echo "Installing packages..."
1420399f 72 sudo apt-get install "$opts" -o APT::Immediate-Configure=false --no-install-recommends -qq -y "${pkgs[@]}"
ce1b5612
SW
73}
74
75install_linux() {
76 install_ubuntu
77}
78
79install_macos() {
80 # Assumes homebrew and python3 are already installed
81 #echo "Updating homebrew..."
82 #brew update >/dev/null 2>&1
83 echo "Installing packages..."
dff32ddb 84 HOMEBREW_NO_AUTO_UPDATE=1 brew install cunit libnfs
5c997f9c 85 pip3 install scipy six sphinx
ce1b5612
SW
86}
87
88main() {
787c02a6
BVA
89 if [ "${CI_TARGET_BUILD}" = "android" ]; then
90 echo "Installing Android NDK..."
91 wget --quiet https://dl.google.com/android/repository/android-ndk-r24-linux.zip
92 unzip -q android-ndk-r24-linux.zip
93 return 0
94 fi
95
ce1b5612
SW
96 set_ci_target_os
97
98 install_function="install_${CI_TARGET_OS}"
99 ${install_function}
100
101 echo "Python3 path: $(type -p python3 2>&1)"
102 echo "Python3 version: $(python3 -V 2>&1)"
103}
104
105main