Merge branch 'cifuzz-integration' of https://github.com/DavidKorczynski/fio
[fio.git] / ci / actions-build.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 main() {
10     local extra_cflags="-Werror"
11     local configure_flags=()
12
13     set_ci_target_os
14     case "${CI_TARGET_OS}" in
15         "linux")
16             case "${CI_TARGET_ARCH}" in
17                 "i686")
18                     extra_cflags="${extra_cflags} -m32"
19                     export LDFLAGS="-m32"
20                     ;;
21                 "x86_64")
22                     configure_flags+=(
23                         "--enable-cuda"
24                         "--enable-libiscsi"
25                         "--enable-libnbd"
26                     )
27                     ;;
28             esac
29         ;;
30     esac
31     configure_flags+=(--extra-cflags="${extra_cflags}")
32
33     ./configure "${configure_flags[@]}"
34     make -j 2
35 }
36
37 main