]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
ci: add meson build permutation
authorEmil Velikov <emil.l.velikov@gmail.com>
Mon, 2 Sep 2024 17:58:35 +0000 (18:58 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 3 Sep 2024 18:19:55 +0000 (13:19 -0500)
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 <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/86
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
.github/actions/setup-alpine/action.yml
.github/actions/setup-archlinux/action.yml
.github/actions/setup-debian/action.yml
.github/actions/setup-fedora/action.yml
.github/actions/setup-ubuntu/action.yml
.github/workflows/main.yml

index 434398f428e95f60d5a1e82a6fa028759505578a..8e092371203657851388f629c4cff7d2ec692a4c 100644 (file)
@@ -16,6 +16,7 @@ runs:
           gtk-doc \
           libtool \
           linux-edge-dev \
+          meson \
           openssl-dev \
           scdoc \
           xz-dev \
index 989739aca2e5c5820561d951a537f09dec6c3e84..54cec61a37cf04cdad0bbc819e8fc6f5f86b02a0 100644 (file)
@@ -16,6 +16,7 @@ runs:
 
         pacman --noconfirm -Su \
           linux-headers \
+          meson \
           scdoc \
           git \
           gtk-doc
index b60cd2eff75423a5d256ec88295e9aa5ad98555d..61cd8d4e1a2b758bf11adc8db7a6d63899d7dd32 100644 (file)
@@ -19,6 +19,7 @@ runs:
           libtool \
           libzstd-dev \
           linux-headers-generic \
+          meson \
           scdoc \
           zlib1g-dev \
           zstd
index 0d963bfe635492b0464cc340c721f84230cf9f29..e7c584626f99ea99e16ecf10fd7089c09820a432 100644 (file)
@@ -16,6 +16,7 @@ runs:
           zlib-devel \
           xz-devel \
           libzstd-devel \
+          meson \
           openssl-devel \
           git \
           gtk-doc \
index 62456d7d50014aeeefb3034aa7b01fe4c05a1c49..b4870fe6c729b17ccd56aee69d1f35a2e2fbd864 100644 (file)
@@ -19,6 +19,7 @@ runs:
           libtool \
           libzstd-dev \
           linux-headers-generic \
+          meson \
           scdoc \
           zlib1g-dev \
           zstd
index 6e25c26f192b45886a719916ce83123c2aed8daa..c1491f11ab84033c57ff70e674bfd0a0ca43417b 100644 (file)
@@ -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