test: add some tests for seq and rand offsets
[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 )
57 ;;
58 esac
59
60 # Architecture-independent packages and packages for which we don't
61 # care about the architecture.
62 pkgs+=(
63 python3-scipy
5c997f9c 64 python3-sphinx
ce1b5612
SW
65 )
66
67 echo "Updating APT..."
68 sudo apt-get -qq update
69 echo "Installing packages..."
1420399f 70 sudo apt-get install "$opts" -o APT::Immediate-Configure=false --no-install-recommends -qq -y "${pkgs[@]}"
ce1b5612
SW
71}
72
73install_linux() {
74 install_ubuntu
75}
76
77install_macos() {
78 # Assumes homebrew and python3 are already installed
79 #echo "Updating homebrew..."
80 #brew update >/dev/null 2>&1
81 echo "Installing packages..."
dff32ddb 82 HOMEBREW_NO_AUTO_UPDATE=1 brew install cunit libnfs
5c997f9c 83 pip3 install scipy six sphinx
ce1b5612
SW
84}
85
86main() {
787c02a6
BVA
87 if [ "${CI_TARGET_BUILD}" = "android" ]; then
88 echo "Installing Android NDK..."
89 wget --quiet https://dl.google.com/android/repository/android-ndk-r24-linux.zip
90 unzip -q android-ndk-r24-linux.zip
91 return 0
92 fi
93
ce1b5612
SW
94 set_ci_target_os
95
96 install_function="install_${CI_TARGET_OS}"
97 ${install_function}
98
99 echo "Python3 path: $(type -p python3 2>&1)"
100 echo "Python3 version: $(python3 -V 2>&1)"
101}
102
103main