# Allowed values are 32, 64 and help.
#
-# Simple helper executing the given function for all bit combinations
+# Simple helper executing the given function for all compiler/bit combinations
#
for_each_config() {
- [[ -n $1 ]] && bits="$1" || bits="32 64"
- [[ -n $2 ]] && suffix="-$2" || suffix=""
- meson_cmd=$3
+ [[ -n $1 ]] && compilers="$1" || compilers="gcc clang"
+ [[ -n $2 ]] && bits="$2" || bits="32 64"
+ [[ -n $3 ]] && suffix="-$3" || suffix=""
+ meson_cmd=$4
- for bit in ${bits[@]}; do
- echo "::group::$bit bit"
- builddir="builddir-$bit$suffix/"
+ for compiler in ${compilers[@]}; do
+ for bit in ${bits[@]}; do
+ echo "::group::$compiler, $bit bit"
+ builddir="builddir-$compiler-$bit$suffix/"
- if [[ "$bit" == "32" ]]; then
- CC="$CC -m32" $meson_cmd "$builddir" "$bit"
- else
- $meson_cmd "$builddir" "$bit"
- fi
+ if [[ "$bit" == "32" ]]; then
+ CC="$compiler -m32" $meson_cmd "$builddir" "$bit"
+ else
+ CC=$compiler $meson_cmd "$builddir" "$bit"
+ fi
- echo "::endgroup::"
+ echo "::endgroup::"
+ done
done
}
jobs:
build:
- env:
- CC: ${{ matrix.compiler }}
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- - compiler: 'gcc'
- container: 'alpine:latest'
+ - container: 'alpine:latest'
meson_setup: '-Ddocs=false -Db_sanitize=none'
only_bits: '64'
- - compiler: 'gcc'
- container: 'archlinux:multilib-devel'
+ - container: 'archlinux:multilib-devel'
skip_test: '32'
- - compiler: 'gcc'
- container: 'debian:bullseye-slim'
+ - container: 'debian:bullseye-slim'
meson_setup: '-Dzstd=disabled -Dxz=disabled -Dzlib=disabled -Dopenssl=enabled -Dtools=true'
+ only_compiler: 'gcc'
skip_test: '32'
- - compiler: 'gcc'
- container: 'debian:unstable'
+ - container: 'debian:unstable'
skip_test: '32'
- - compiler: 'gcc'
- container: 'fedora:latest'
+ - container: 'fedora:latest'
only_bits: '64'
- - compiler: 'gcc'
- container: 'fedora:latest'
+ - container: 'fedora:latest'
meson_setup: '-Dxz=disabled -Ddlopen=all'
only_bits: '64'
custom: 'no-xz-dlopen-all'
- - compiler: 'gcc'
- container: 'ubuntu:22.04'
+ - container: 'ubuntu:22.04'
skip_test: '32'
- - compiler: 'gcc'
- container: 'ubuntu:22.04'
+ - container: 'ubuntu:22.04'
meson_setup: '-Ddlopen=zstd,zlib'
only_bits: '64'
custom: 'dlopen-zstd-zlib'
- - compiler: 'gcc'
- container: 'ubuntu:24.04'
- skip_test: '32'
-
- # clang variations of the same builds
-
- - compiler: 'clang'
- container: 'alpine:latest'
- meson_setup: '-Ddocs=false -Db_sanitize=none'
- only_bits: '64'
- - compiler: 'clang'
- container: 'archlinux:multilib-devel'
- skip_test: '32'
- - compiler: 'clang'
- container: 'debian:unstable'
- skip_test: '32'
- # Disabled because it doesn't work
- # - compiler: 'clang'
- # container: 'debian:bullseye-slim'
- # meson_setup: '-Dzstd=disabled -Dxz=disabled -Dzlib=disabled -Dopenssl=enabled -Dtools=true'
- # skip_test: '32'
- - compiler: 'clang'
- container: 'fedora:latest'
- only_bits: '64'
- - compiler: 'clang'
- container: 'fedora:latest'
- meson_setup: '-Dxz=disabled -Ddlopen=all'
- only_bits: '64'
- custom: 'no-xz-dlopen-all'
- - compiler: 'clang'
- container: 'ubuntu:22.04'
- skip_test: '32'
- - compiler: 'clang'
- container: 'ubuntu:22.04'
- meson_setup: '-Ddlopen=zstd,zlib'
- only_bits: '64'
- custom: 'dlopen-zstd-zlib'
- - compiler: 'clang'
- container: 'ubuntu:24.04'
+ - container: 'ubuntu:24.04'
skip_test: '32'
# Special configurations
# Variant with lld as linker
- - compiler: 'clang'
- container: 'archlinux:multilib-devel'
+ - container: 'archlinux:multilib-devel'
only_bits: '64'
+ only_compiler: 'clang'
+ custom: 'ldd-as-linker'
linker: 'lld'
# Variants with moduledir
- - compiler: 'gcc'
- container: 'archlinux:multilib-devel'
+ - container: 'archlinux:multilib-devel'
meson_setup: '-Dmoduledir=/usr/lib/modules'
only_bits: '64'
- - compiler: 'gcc'
- container: 'archlinux:multilib-devel'
+ only_compiler: 'gcc'
+ custom: 'usr-moduledir'
+ - container: 'archlinux:multilib-devel'
meson_setup: '-Dmoduledir=/kernel-modules'
only_bits: '64'
+ only_compiler: 'gcc'
+ custom: 'custom-moduledir'
container:
image: ${{ matrix.container }}
}
source .github/functions.sh
- for_each_config "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_setup
+ for_each_config "${{ matrix.only_compiler }}" "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_setup
- name: build
run: |
meson compile -C "$1"
}
source .github/functions.sh
- for_each_config "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_build
+ for_each_config "${{ matrix.only_compiler }}" "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_build
- name: test
run: |
meson test -C "$1" || meson test -C "$1" --verbose
}
source .github/functions.sh
- for_each_config "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_test
+ for_each_config "${{ matrix.only_compiler }}" "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_test
- name: install
run: |
DESTDIR=$PWD/inst meson install -C "$1"
}
source .github/functions.sh
- for_each_config "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_install
+ for_each_config "${{ matrix.only_compiler }}" "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_install
- name: distcheck
run: |
meson dist -C "$1"
}
source .github/functions.sh
- for_each_config "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_distcheck
+ for_each_config "${{ matrix.only_compiler }}" "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_distcheck