Some __attribute__ inspired changes #1087
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # SPDX-FileCopyrightText: 2024 Emil Velikov <emil.l.velikov@gmail.com> | |
| # SPDX-FileCopyrightText: 2024 Lucas De Marchi <lucas.de.marchi@gmail.com> | |
| # | |
| # SPDX-License-Identifier: LGPL-2.1-or-later | |
| name: Build and Test | |
| on: | |
| push: | |
| branches: [master, ci-test] | |
| pull_request: | |
| branches: [master] | |
| schedule: | |
| - cron: "30 2 * * 0" | |
| permissions: | |
| contents: read | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - container: 'alpine:latest' | |
| meson_setup: '-Db_sanitize=none' | |
| only_bits: '64' | |
| - container: 'archlinux:multilib-devel' | |
| skip_test: '32' | |
| - container: 'debian:bullseye-slim' | |
| meson_setup: '-Dzstd=disabled -Dxz=disabled -Dzlib=disabled -Dopenssl=enabled -Dtools=true' | |
| only_compiler: 'gcc' | |
| skip_test: '32' | |
| - container: 'debian:unstable' | |
| skip_test: '32' | |
| - container: 'fedora:latest' | |
| only_bits: '64' | |
| - container: 'fedora:latest' | |
| meson_setup: '-Dxz=disabled -Ddlopen=all' | |
| only_bits: '64' | |
| custom: 'no-xz-dlopen-all' | |
| - container: 'ubuntu:22.04' | |
| skip_test: '32' | |
| - container: 'ubuntu:22.04' | |
| meson_setup: '-Ddlopen=zstd,zlib' | |
| only_bits: '64' | |
| custom: 'dlopen-zstd-zlib' | |
| - container: 'ubuntu:24.04' | |
| skip_test: '32' | |
| # Special configurations | |
| # Variant with lld as linker | |
| - container: 'archlinux:multilib-devel' | |
| only_bits: '64' | |
| only_compiler: 'clang' | |
| custom: 'ldd-as-linker' | |
| linker: 'lld' | |
| # Variants with moduledir | |
| - container: 'archlinux:multilib-devel' | |
| meson_setup: '-Dmoduledir=/usr/lib/modules' | |
| only_bits: '64' | |
| 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 }} | |
| steps: | |
| - name: Sparse checkout the local actions | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| with: | |
| sparse-checkout: .github | |
| path: local-actions | |
| - name: Setup OS | |
| uses: ./local-actions/.github/actions/setup-os | |
| - name: Cleanup local actions | |
| run: | | |
| rm -rf local-actions | |
| # The sparse checkout with REST API creates the current dir with the wrong | |
| # user. Tell git to just ignore. | |
| git config --global --add safe.directory '*' | |
| - name: Checkout | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: Set the environment | |
| run: | | |
| .github/print-kdir.sh >> "$GITHUB_ENV" | |
| - name: configure checks | |
| run: | | |
| should_fail() { | |
| rm -rf build-setup-test/ | |
| if meson setup "$@" build-setup-test/; then | |
| echo Command was expected to fail, but was successful | |
| return 1 | |
| fi | |
| } | |
| should_pass() { | |
| rm -rf build-setup-test/ | |
| meson setup "$@" build-setup-test/ | |
| } | |
| should_fail -D distconfdir=relative/ | |
| should_fail -D moduledir=relative/ | |
| should_fail -D dlopen=nonexistent | |
| should_fail -D xz=disabled -D dlopen=xz | |
| should_pass -D dlopen=xz | |
| should_pass -D dlopen=xz -D xz=enabled | |
| - name: configure | |
| run: | | |
| do_setup() { | |
| setup_options="${{ matrix.meson_setup }}" | |
| if [[ "$2" == "32" ]]; then | |
| echo "::notice::TODO fix and reuse the original options." | |
| setup_options="$setup_options -Dzstd=disabled -Dxz=disabled -Dzlib=disabled -Dopenssl=disabled" | |
| fi | |
| [[ -n "${{ matrix.linker }}" ]] && export CC_LD="${{ matrix.linker }}" | |
| meson setup --native-file build-dev.ini $setup_options "$1" | |
| } | |
| source .github/functions.sh | |
| for_each_config "${{ matrix.only_compiler }}" "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_setup | |
| - name: build | |
| run: | | |
| do_build() { | |
| meson compile -C "$1" | |
| } | |
| source .github/functions.sh | |
| for_each_config "${{ matrix.only_compiler }}" "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_build | |
| - name: test | |
| run: | | |
| do_test() { | |
| if [[ -n "${{ matrix.skip_test }}" && "${{ matrix.skip_test }}" == "$2" ]]; then | |
| echo "::notice::Skipping tests" | |
| return 0 | |
| fi | |
| meson test -C "$1" || meson test -C "$1" --verbose | |
| } | |
| source .github/functions.sh | |
| for_each_config "${{ matrix.only_compiler }}" "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_test | |
| - name: install | |
| run: | | |
| do_install() { | |
| DESTDIR=$PWD/inst meson install -C "$1" | |
| } | |
| source .github/functions.sh | |
| for_each_config "${{ matrix.only_compiler }}" "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_install | |
| - name: distcheck | |
| run: | | |
| do_distcheck() { | |
| if [[ "$2" == "32" ]]; then | |
| echo "::notice::Skipping 32bit distcheck" | |
| return 0 | |
| fi | |
| meson dist -C "$1" | |
| } | |
| source .github/functions.sh | |
| for_each_config "${{ matrix.only_compiler }}" "${{ matrix.only_bits }}" "${{ matrix.custom }}" do_distcheck |