t/nvmept_trim: increase transfer size for some tests
[fio.git] / ci / actions-build.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
9main() {
10 local extra_cflags="-Werror"
11 local configure_flags=()
12
13 set_ci_target_os
787c02a6 14 case "${CI_TARGET_BUILD}/${CI_TARGET_OS}" in
9b3cc2dd 15 android*/*)
787c02a6
BVA
16 export UNAME=Android
17 if [ -z "${CI_TARGET_ARCH}" ]; then
18 echo "Error: CI_TARGET_ARCH has not been set"
19 return 1
20 fi
21 NDK=$PWD/android-ndk-r24/toolchains/llvm/prebuilt/linux-x86_64/bin
22 export PATH="${NDK}:${PATH}"
9b3cc2dd
BVA
23 if [ "${CI_TARGET_BUILD}" = "android" ]; then
24 export LIBS="-landroid"
25 fi
787c02a6
BVA
26 CC=${NDK}/${CI_TARGET_ARCH}-clang
27 if [ ! -e "${CC}" ]; then
28 echo "Error: could not find ${CC}"
29 return 1
30 fi
31 ;;
32 */linux)
ce1b5612
SW
33 case "${CI_TARGET_ARCH}" in
34 "i686")
35 extra_cflags="${extra_cflags} -m32"
36 export LDFLAGS="-m32"
37 ;;
38 "x86_64")
39 configure_flags+=(
40 "--enable-cuda"
41 "--enable-libiscsi"
42 "--enable-libnbd"
43 )
44 ;;
45 esac
89d08880
VF
46 ;;
47 */windows)
48 configure_flags+=("--disable-native")
49 case "${CI_TARGET_ARCH}" in
50 "i686")
51 configure_flags+=("--build-32bit-win")
52 ;;
53 "x86_64")
54 ;;
55 esac
4820d46c
VF
56 if [ "${CI_TARGET_BUILD}" = "windows-msys2-64" ]; then
57 configure_flags+=("--disable-tls")
58 fi
89d08880 59 ;;
ce1b5612
SW
60 esac
61 configure_flags+=(--extra-cflags="${extra_cflags}")
62
63 ./configure "${configure_flags[@]}"
aa84b5ba
VF
64 make -j "$(nproc 2>/dev/null || sysctl -n hw.logicalcpu)"
65# macOS does not have nproc, so we have to use sysctl to obtain the number of
66# logical CPUs.
ce1b5612
SW
67}
68
69main