From: Emil Velikov Date: Mon, 2 Sep 2024 17:58:35 +0000 (+0100) Subject: ci: add meson build permutation X-Git-Tag: v34~456 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=18c49d0598afe87796e3b9981df4ff9e94308f62;p=thirdparty%2Fkmod.git ci: add meson build permutation Note that we cannot use conditionals within the run actions, because coreutils (for [ and test) are not installed on Debian/Ubuntu. Even after doing so, the script consistently fails. For meson dist to work, we need a full git repo, git and safe directories setup, otherwise it fails as below. Meson issue was reported ~2 years ago and we're about to get a fix soon (tm). Dist currently only works with Git or Mercurial repos v2: - split git/checkout to separate patch - use build-dev.ini instead of meson.sh v3: - use matrix for setting 'test' variable Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/86 Signed-off-by: Lucas De Marchi --- diff --git a/.github/actions/setup-alpine/action.yml b/.github/actions/setup-alpine/action.yml index 434398f4..8e092371 100644 --- a/.github/actions/setup-alpine/action.yml +++ b/.github/actions/setup-alpine/action.yml @@ -16,6 +16,7 @@ runs: gtk-doc \ libtool \ linux-edge-dev \ + meson \ openssl-dev \ scdoc \ xz-dev \ diff --git a/.github/actions/setup-archlinux/action.yml b/.github/actions/setup-archlinux/action.yml index 989739ac..54cec61a 100644 --- a/.github/actions/setup-archlinux/action.yml +++ b/.github/actions/setup-archlinux/action.yml @@ -16,6 +16,7 @@ runs: pacman --noconfirm -Su \ linux-headers \ + meson \ scdoc \ git \ gtk-doc diff --git a/.github/actions/setup-debian/action.yml b/.github/actions/setup-debian/action.yml index b60cd2ef..61cd8d4e 100644 --- a/.github/actions/setup-debian/action.yml +++ b/.github/actions/setup-debian/action.yml @@ -19,6 +19,7 @@ runs: libtool \ libzstd-dev \ linux-headers-generic \ + meson \ scdoc \ zlib1g-dev \ zstd diff --git a/.github/actions/setup-fedora/action.yml b/.github/actions/setup-fedora/action.yml index 0d963bfe..e7c58462 100644 --- a/.github/actions/setup-fedora/action.yml +++ b/.github/actions/setup-fedora/action.yml @@ -16,6 +16,7 @@ runs: zlib-devel \ xz-devel \ libzstd-devel \ + meson \ openssl-devel \ git \ gtk-doc \ diff --git a/.github/actions/setup-ubuntu/action.yml b/.github/actions/setup-ubuntu/action.yml index 62456d7d..b4870fe6 100644 --- a/.github/actions/setup-ubuntu/action.yml +++ b/.github/actions/setup-ubuntu/action.yml @@ -19,6 +19,7 @@ runs: libtool \ libzstd-dev \ linux-headers-generic \ + meson \ scdoc \ zlib1g-dev \ zstd diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6e25c26f..c1491f11 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,22 +16,23 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - include: - - container: 'ubuntu:22.04' - test: 'yes' - - container: 'ubuntu:24.04' - test: 'yes' - - container: 'archlinux:base-devel' - test: 'yes' - - container: 'fedora:latest' - test: 'yes' - - container: 'alpine:latest' - test: 'no' - - container: 'debian:unstable' - test: 'yes' + build: ['meson', 'autotools'] + container: + - name: 'ubuntu:22.04' + test: 'true' + - name: 'ubuntu:24.04' + test: 'true' + - name: 'archlinux:base-devel' + test: 'true' + - name: 'fedora:latest' + test: 'true' + - name: 'alpine:latest' + test: 'false' + - name: 'debian:unstable' + test: 'true' container: - image: ${{ matrix.container }} + image: ${{ matrix.container.name }} steps: - name: Sparse checkout the local actions @@ -40,15 +41,15 @@ jobs: sparse-checkout: .github - uses: ./.github/actions/setup-ubuntu - if: ${{ startsWith(matrix.container, 'ubuntu') }} + if: ${{ startsWith(matrix.container.name, 'ubuntu') }} - uses: ./.github/actions/setup-archlinux - if: ${{ startsWith(matrix.container, 'archlinux') }} + if: ${{ startsWith(matrix.container.name, 'archlinux') }} - uses: ./.github/actions/setup-fedora - if: ${{ startsWith(matrix.container, 'fedora') }} + if: ${{ startsWith(matrix.container.name, 'fedora') }} - uses: ./.github/actions/setup-alpine - if: ${{ startsWith(matrix.container, 'alpine') }} + if: ${{ startsWith(matrix.container.name, 'alpine') }} - uses: ./.github/actions/setup-debian - if: ${{ startsWith(matrix.container, 'debian') }} + if: ${{ startsWith(matrix.container.name, 'debian') }} - name: Checkout the whole project uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 @@ -72,30 +73,42 @@ jobs: fi echo "KDIR=$moddir/$kernel/build" >> "$GITHUB_ENV" - - name: configure - run: | - mkdir build - cd build - ../autogen.sh c + - name: configure (meson) + if: ${{ matrix.build == 'meson' }} + run: mkdir build && cd build && meson setup --native-file ../build-dev.ini -D build-tests=${{ matrix.container.test }} . .. - - name: build - run: | - cd build - make -j$(nproc) + - name: configure (autotools) + if: ${{ matrix.build == 'autotools' }} + run: mkdir build && cd build && ../autogen.sh c - - name: test - if: ${{ matrix.test == 'yes' }} - run: | - cd build - make -j$(nproc) check + - name: build (meson) + if: ${{ matrix.build == 'meson' }} + run: cd build && meson compile - - name: install - run: | - cd build - DESTDIR=$PWD/inst make install + - name: build (autotools) + if: ${{ matrix.build == 'autotools' }} + run: cd build && make -j$(nproc) - - name: distcheck - if: ${{ matrix.test == 'yes' }} - run: | - cd build - make distcheck + - name: test (meson) + if: ${{ matrix.test == 'true' && matrix.build == 'meson' }} + run: cd build && meson test + + - name: test (autotools) + if: ${{ matrix.test == 'true' && matrix.build == 'autotools' }} + run: cd build && make -j$(nproc) check + + - name: install (meson) + if: ${{ matrix.build == 'meson' }} + run: cd build && DESTDIR=$PWD/inst meson install + + - name: install (autotools) + if: ${{ matrix.build == 'autotools' }} + run: cd build && DESTDIR=$PWD/inst make install + + - name: distcheck (meson) + if: ${{ matrix.test == 'true' && matrix.build == 'meson' }} + run: cd build && meson dist + + - name: distcheck (autotools) + if: ${{ matrix.test == 'true' && matrix.build == 'autotools' }} + run: cd build && make distcheck