fi
done
}
-trap on_error EXIT
+# We capture the error logs as artifacts in Github Actions, no need to dump
+# them via a EXIT handler.
+[ -n "$GITHUB_WORKFLOW" ] || trap on_error EXIT
install_libabigail() {
version=$1
rm ${version}.tar.gz
}
-if [ "$AARCH64" = "1" ]; then
+if [ "$AARCH64" = "true" ]; then
# convert the arch specifier
OPTS="$OPTS --cross-file config/arm/arm64_armv8_linux_gcc"
fi
-if [ "$BUILD_DOCS" = "1" ]; then
+if [ "$BUILD_DOCS" = "true" ]; then
OPTS="$OPTS -Denable_docs=true"
fi
-if [ "$BUILD_32BIT" = "1" ]; then
+if [ "$BUILD_32BIT" = "true" ]; then
OPTS="$OPTS -Dc_args=-m32 -Dc_link_args=-m32"
export PKG_CONFIG_LIBDIR="/usr/lib32/pkgconfig"
fi
OPTS="$OPTS -Dexamples=all"
fi
+OPTS="$OPTS -Dmachine=default"
OPTS="$OPTS --default-library=$DEF_LIB"
OPTS="$OPTS --buildtype=debugoptimized"
meson build --werror $OPTS
ninja -C build
-if [ "$AARCH64" != "1" ]; then
+if [ "$AARCH64" != "true" ]; then
devtools/test-null.sh
fi
-if [ "$ABI_CHECKS" = "1" ]; then
+if [ "$ABI_CHECKS" = "true" ]; then
LIBABIGAIL_VERSION=${LIBABIGAIL_VERSION:-libabigail-1.6}
if [ "$(cat libabigail/VERSION 2>/dev/null)" != "$LIBABIGAIL_VERSION" ]; then
devtools/check-abi.sh reference install ${ABI_CHECKS_WARN_ONLY:-}
fi
-if [ "$RUN_TESTS" = "1" ]; then
+if [ "$RUN_TESTS" = "true" ]; then
sudo meson test -C build --suite fast-tests -t 3
fi
--- /dev/null
+name: build
+
+on:
+ push:
+ schedule:
+ - cron: '0 0 * * 1'
+
+defaults:
+ run:
+ shell: bash --noprofile --norc -exo pipefail {0}
+
+jobs:
+ build:
+ name: ${{ join(matrix.config.*, '-') }}
+ runs-on: ${{ matrix.config.os }}
+ env:
+ AARCH64: ${{ matrix.config.cross == 'aarch64' }}
+ BUILD_32BIT: ${{ matrix.config.cross == 'i386' }}
+ BUILD_DOCS: ${{ contains(matrix.config.checks, 'doc') }}
+ CC: ccache ${{ matrix.config.compiler }}
+ DEF_LIB: ${{ matrix.config.library }}
+ RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }}
+
+ strategy:
+ fail-fast: false
+ matrix:
+ config:
+ - os: ubuntu-18.04
+ compiler: gcc
+ library: static
+ - os: ubuntu-18.04
+ compiler: gcc
+ library: shared
+ checks: doc+tests
+ - os: ubuntu-18.04
+ compiler: clang
+ library: static
+ - os: ubuntu-18.04
+ compiler: clang
+ library: shared
+ checks: doc+tests
+ - os: ubuntu-18.04
+ compiler: gcc
+ library: static
+ cross: i386
+ - os: ubuntu-18.04
+ compiler: gcc
+ library: static
+ cross: aarch64
+ - os: ubuntu-18.04
+ compiler: gcc
+ library: shared
+ cross: aarch64
+
+ steps:
+ - name: Checkout sources
+ uses: actions/checkout@v2
+ - name: Generate cache keys
+ id: get_ref_keys
+ run: |
+ echo -n '::set-output name=ccache::'
+ echo 'ccache-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-'$(date -u +%Y-w%W)
+ - name: Retrieve ccache cache
+ uses: actions/cache@v2
+ with:
+ path: ~/.ccache
+ key: ${{ steps.get_ref_keys.outputs.ccache }}-${{ github.ref }}
+ restore-keys: |
+ ${{ steps.get_ref_keys.outputs.ccache }}-refs/heads/main
+ - name: Install packages
+ run: sudo apt install -y ccache libnuma-dev python3-setuptools
+ python3-wheel python3-pip ninja-build libbsd-dev libpcap-dev
+ libibverbs-dev libcrypto++-dev libfdt-dev libjansson-dev
+ - name: Install i386 cross compiling packages
+ if: env.BUILD_32BIT == 'true'
+ run: sudo apt install -y gcc-multilib
+ - name: Install aarch64 cross compiling packages
+ if: env.AARCH64 == 'true'
+ run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
+ pkg-config-aarch64-linux-gnu
+ - name: Install doc generation packages
+ if: env.BUILD_DOCS == 'true'
+ run: sudo apt install -y doxygen graphviz python3-sphinx
+ python3-sphinx-rtd-theme
+ - name: Run setup
+ run: |
+ .ci/linux-setup.sh
+ # Workaround on $HOME permissions as EAL checks them for plugin loading
+ chmod o-w $HOME
+ - name: Build and test
+ run: .ci/linux-build.sh
+ - name: Upload logs on failure
+ if: failure()
+ uses: actions/upload-artifact@v2
+ with:
+ name: meson-logs-${{ join(matrix.config.*, '-') }}
+ path: |
+ build/meson-logs/testlog.txt
+ build/.ninja_log
+ build/meson-logs/meson-log.txt
- env: DEF_LIB="static"
arch: amd64
compiler: gcc
- - env: DEF_LIB="shared" RUN_TESTS=1
+ - env: DEF_LIB="shared" RUN_TESTS=true
arch: amd64
compiler: gcc
- - env: DEF_LIB="shared" BUILD_DOCS=1
+ - env: DEF_LIB="shared" BUILD_DOCS=true
arch: amd64
compiler: gcc
addons:
- env: DEF_LIB="static"
arch: amd64
compiler: clang
- - env: DEF_LIB="shared" RUN_TESTS=1
+ - env: DEF_LIB="shared" RUN_TESTS=true
arch: amd64
compiler: clang
- - env: DEF_LIB="shared" BUILD_DOCS=1
+ - env: DEF_LIB="shared" BUILD_DOCS=true
arch: amd64
compiler: clang
addons:
- *required_packages
- *doc_packages
# x86_64 cross-compiling 32-bits jobs
- - env: DEF_LIB="static" BUILD_32BIT=1
+ - env: DEF_LIB="static" BUILD_32BIT=true
arch: amd64
compiler: gcc
addons:
packages:
- *build_32b_packages
# x86_64 cross-compiling aarch64 jobs
- - env: DEF_LIB="static" AARCH64=1
+ - env: DEF_LIB="static" AARCH64=true
arch: amd64
compiler: gcc
addons:
apt:
packages:
- *aarch64_packages
- - env: DEF_LIB="shared" AARCH64=1
+ - env: DEF_LIB="shared" AARCH64=true
arch: amd64
compiler: gcc
addons:
- env: DEF_LIB="static"
arch: arm64
compiler: gcc
- - env: DEF_LIB="shared" RUN_TESTS=1
+ - env: DEF_LIB="shared" RUN_TESTS=true
arch: arm64
compiler: gcc
- - env: DEF_LIB="shared" RUN_TESTS=1
+ - env: DEF_LIB="shared" RUN_TESTS=true
dist: focal
arch: arm64-graviton2
virt: vm
group: edge
compiler: gcc
- - env: DEF_LIB="shared" BUILD_DOCS=1
+ - env: DEF_LIB="shared" BUILD_DOCS=true
arch: arm64
compiler: gcc
addons:
- env: DEF_LIB="static"
arch: arm64
compiler: clang
- - env: DEF_LIB="shared" RUN_TESTS=1
+ - env: DEF_LIB="shared" RUN_TESTS=true
arch: arm64
compiler: clang
- - env: DEF_LIB="shared" RUN_TESTS=1
+ - env: DEF_LIB="shared" RUN_TESTS=true
dist: focal
arch: arm64-graviton2
virt: vm
M: Aaron Conole <aconole@redhat.com>
M: Michael Santana <maicolgabriel@hotmail.com>
F: .travis.yml
+F: .github/workflows/build.yml
F: .ci/
ABI Policy & Versioning