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
- 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 \
libzstd-dev \
linux-headers-generic \
scdoc \
+ zlib1g-dev \
zstd
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
- name: test
run: |
cd build
- make -j$(nproc) check
+ make KDIR=/usr/lib/modules/*/build -j$(nproc) check
- name: install
run: |
- name: distcheck
run: |
cd build
- make distcheck
+ make KDIR=/usr/lib/modules/*/build distcheck