]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
ci: Use a container and expand versions
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 12 Jul 2024 16:06:07 +0000 (11:06 -0500)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Wed, 17 Jul 2024 17:37:51 +0000 (12:37 -0500)
Use containers to build/test so it's not restricted to the OS versions
supported by Github runners. A few changes are needed to the workflow to
support using containers:

1) No need for sudo, so remove it
2) Explicitly install missing zlib
3) Explicitly pass KDIR= while building kernel modules, since it
   won't match `uname -r`. This assumes the container has just
   one kernel installed and so /usr/lib/modules/*/build can be
   used as the single symlink to the kernel headers. This should
   be common to other distros to be added, too.

Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Reviewed-by: Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/44
.github/actions/setup-ubuntu/action.yml
.github/workflows/main.yml

index 554d261fc47e8d67554e7c5c875af56664f9e250..f60cb1de43fb2f8243f4124ae02c05061bbbefe2 100644 (file)
@@ -6,8 +6,8 @@ runs:
     - name: Install dependencies
       shell: bash
       run: |
-        sudo apt-get update
-        sudo apt-get install --yes \
+        apt-get update
+        apt-get install --yes \
           build-essential \
           autoconf \
           automake \
@@ -19,4 +19,5 @@ runs:
           libzstd-dev \
           linux-headers-generic \
           scdoc \
+          zlib1g-dev \
           zstd
index fa9c9b94e706e6524448813c5474be7998da546c..a9ad28924a617e9fe5c29ac651f6ce88fd5a4a3d 100644 (file)
@@ -9,6 +9,13 @@ on:
 jobs:
   build:
     runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        container: ['ubuntu:22.04', 'ubuntu:24.04']
+
+    container:
+      image: ${{ matrix.container }}
+
     steps:
       - uses: actions/checkout@v4
       - uses: ./.github/actions/setup-ubuntu
@@ -27,7 +34,7 @@ jobs:
       - name: test
         run: |
           cd build
-          make -j$(nproc) check
+          make KDIR=/usr/lib/modules/*/build -j$(nproc) check
 
       - name: install
         run: |
@@ -37,4 +44,4 @@ jobs:
       - name: distcheck
         run: |
           cd build
-          make distcheck
+          make KDIR=/usr/lib/modules/*/build distcheck