Add distros to github CI
cover Add distros to github CI
Add a few distros to CI to improve coverage. This is now executed on Ubuntu 24.04, Ubuntu 22.04, Fedora (latest), Archlinux and Alpine (latest).
For Alpine, the testsuite is disabled as it's currently not working. It can be enabled once fixed.
Results:
https://github.com/kmod-project/kmod/actions/runs/9913631414
Also available as a Github PR:
https://github.com/kmod-project/kmod/pull/44
Lucas De Marchi (5):
ci: Replace package installation with local action
ci: Use a container and expand versions
ci: Add Archlinux
ci: Add Fedora
ci: Add Alpine
.github/actions/setup-alpine/action.yml | 22 ++++++++++ .github/actions/setup-archlinux/action.yml | 16 ++++++++ .github/actions/setup-fedora/action.yml | 27 +++++++++++++ .github/actions/setup-ubuntu/action.yml | 23 +++++++++++ .github/workflows/main.yml | 47 +++++++++++++--------- 5 files changed, 117 insertions(+), 18 deletions(-) create mode 100644 .github/actions/setup-alpine/action.yml create mode 100644 .github/actions/setup-archlinux/action.yml create mode 100644 .github/actions/setup-fedora/action.yml create mode 100644 .github/actions/setup-ubuntu/action.yml
Signature · 1 line
2.45.2
PATCH 1/5 ci: Replace package installation with local action
Separate the package installation step with a local action so it's easier to support more versions and distros.
--- .github/actions/setup-ubuntu/action.yml | 22 ++++++++++++++++++++++ .github/workflows/main.yml | 18 +----------------- 2 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 .github/actions/setup-ubuntu/action.yml
.github/actions/setup-ubuntu/action.yml new file +22 -0
@@ -0,0 +1,22 @@ +name: 'setup Ubuntu' +description: 'Setup an Ubuntu container for running CI' +runs: + using: 'composite' + steps: + - name: Install dependencies + shell: bash + run: | + sudo apt-get update + sudo apt-get install --yes \ + build-essential \ + autoconf \ + automake \ + gtk-doc-tools \ + libssl-dev \ + liblzma-dev \ + libssl-dev \ + libtool \ + libzstd-dev \ + linux-headers-generic \ + scdoc \ + zstd
.github/workflows/main.yml +1 -17
@@ -11,23 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - - name: install dependencies - run: | - sudo apt-get update - sudo apt-get install --yes \ - build-essential \ - autoconf \ - automake \ - gtk-doc-tools \ - libssl-dev \ - liblzma-dev \ - libssl-dev \ - libtool \ - libzstd-dev \ - linux-headers-generic \ - scdoc \ - zstd \ + - uses: ./.github/actions/setup-ubuntu - name: configure run: |
Signature · 1 line
2.45.2
PATCH 2/5 ci: Use a container and expand versions
In reply to Lucas De MarchiUse 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.
--- .github/actions/setup-ubuntu/action.yml | 5 +++-- .github/workflows/main.yml | 11 +++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-)
.github/actions/setup-ubuntu/action.yml +3 -2
@@ -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
.github/workflows/main.yml +9 -2
@@ -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
Signature · 1 line
2.45.2
PATCH 3/5 ci: Add Archlinux
In reply to Lucas De MarchiAdd an action to setup Archlinux and use it for the initial setup. The rest of the workflow can stay the same.
--- .github/actions/setup-archlinux/action.yml | 16 ++++++++++++++++ .github/workflows/main.yml | 6 +++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 .github/actions/setup-archlinux/action.yml
.github/actions/setup-archlinux/action.yml new file +16 -0
@@ -0,0 +1,16 @@ +name: 'setup Archlinux' +description: 'Setup an Archlinux container for running CI' +runs: + using: 'composite' + steps: + - name: Install dependencies + shell: bash + run: | + rm -rf /etc/pacman.d/gnupg + pacman-key --init + pacman-key --populate + pacman --noconfirm -Sy archlinux-keyring + pacman --noconfirm -Su \ + linux-headers \ + scdoc \ + gtk-doc
.github/workflows/main.yml +5 -1
@@ -11,14 +11,18 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - container: ['ubuntu:22.04', 'ubuntu:24.04'] + container: ['ubuntu:22.04', 'ubuntu:24.04', 'archlinux:base-devel'] container: image: ${{ matrix.container }} steps: - uses: actions/checkout@v4 + - uses: ./.github/actions/setup-ubuntu + if: ${{ startsWith(matrix.container, 'ubuntu') }} + - uses: ./.github/actions/setup-archlinux + if: ${{ startsWith(matrix.container, 'archlinux') }} - name: configure run: |
Signature · 1 line
2.45.2
PATCH 4/5 ci: Add Fedora
In reply to Lucas De MarchiAdd an action to setup latest Fedora and use it for the initial setup. Add hack on /usr/lib/modules so /usr/lib/modules/*/build can still be used in the rest of the workflow as the KDIR.
--- .github/actions/setup-fedora/action.yml | 27 +++++++++++++++++++++++++ .github/workflows/main.yml | 4 +++- 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 .github/actions/setup-fedora/action.yml
.github/actions/setup-fedora/action.yml new file +27 -0
@@ -0,0 +1,27 @@ +name: 'setup Fedora' +description: 'Setup a Fedora container for running CI' +runs: + using: 'composite' + steps: + - name: Install dependencies + shell: bash + run: | + dnf update -y + dnf install -y \ + autoconf \ + automake \ + make \ + gcc \ + kernel-devel \ + zlib-devel \ + xz-devel \ + libzstd-devel \ + openssl-devel \ + gtk-doc \ + libtool \ + scdoc + # CI builds with KDIR pointing to /usr/lib/modules/*/build + # so just a foo/build pointing to the right place, assuming + # just one kernel installed + mkdir -p /usr/lib/modules/foo/ + ln -s /usr/src/kernels/* /usr/lib/modules/foo/build
.github/workflows/main.yml +3 -1
@@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - container: ['ubuntu:22.04', 'ubuntu:24.04', 'archlinux:base-devel'] + container: ['ubuntu:22.04', 'ubuntu:24.04', 'archlinux:base-devel', 'fedora:latest'] container: image: ${{ matrix.container }}
@@ -23,6 +23,8 @@ jobs: if: ${{ startsWith(matrix.container, 'ubuntu') }} - uses: ./.github/actions/setup-archlinux if: ${{ startsWith(matrix.container, 'archlinux') }} + - uses: ./.github/actions/setup-fedora + if: ${{ startsWith(matrix.container, 'fedora') }} - name: configure run: |
Signature · 1 line
2.45.2
PATCH 5/5 ci: Add Alpine
In reply to Lucas De MarchiAdd setup action for Alpine and start building it. Unfortunately the testsuite is not ready yet and fails to build like this:
../testsuite/path.c:219:14: error: conflicting types for '__xstat64'; have 'int(int, const char *, struct stat64 *)' 219 | WRAP_VERSTAT(__x,64); | ^~~
Add everything needed on the setup action, so when the underlying issue is fixed, the testsuite can be enabled in CI.
--- .github/actions/setup-alpine/action.yml | 22 ++++++++++++++++++++++ .github/workflows/main.yml | 16 +++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .github/actions/setup-alpine/action.yml
.github/actions/setup-alpine/action.yml new file +22 -0
@@ -0,0 +1,22 @@ +name: 'setup Alpine' +description: 'Setup an Alpine container for running CI' +runs: + using: 'composite' + steps: + - name: Install dependencies + shell: sh + run: | + apk update + apk add \ + autoconf \ + automake \ + bash \ + build-base \ + gtk-doc \ + libtool \ + linux-edge-dev \ + openssl-dev \ + scdoc \ + xz-dev \ + zlib-dev \ + zstd-dev
.github/workflows/main.yml +15 -1
@@ -11,7 +11,17 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - container: ['ubuntu:22.04', 'ubuntu:24.04', 'archlinux:base-devel', 'fedora:latest'] + 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: image: ${{ matrix.container }}
@@ -25,6 +35,8 @@ jobs: if: ${{ startsWith(matrix.container, 'archlinux') }} - uses: ./.github/actions/setup-fedora if: ${{ startsWith(matrix.container, 'fedora') }} + - uses: ./.github/actions/setup-alpine + if: ${{ startsWith(matrix.container, 'alpine') }} - name: configure run: |
@@ -38,6 +50,7 @@ jobs: make -j$(nproc) - name: test + if: ${{ matrix.test == 'yes' }} run: | cd build make KDIR=/usr/lib/modules/*/build -j$(nproc) check
@@ -48,6 +61,7 @@ jobs: DESTDIR=$PWD/inst make install - name: distcheck + if: ${{ matrix.test == 'yes' }} run: | cd build make KDIR=/usr/lib/modules/*/build distcheck
Signature · 1 line
2.45.2
Quoted 13 lines · Lucas De Marchi
Add a few distros to CI to improve coverage. This is now executed on Ubuntu 24.04, Ubuntu 22.04, Fedora (latest), Archlinux and Alpine (latest).
For Alpine, the testsuite is disabled as it's currently not working. It can be enabled once fixed.
Results:
https://github.com/kmod-project/kmod/actions/runs/9913631414Also available as a Github PR:
https://github.com/kmod-project/kmod/pull/44
Quoted 6 lines
Lucas De Marchi (5):
ci: Replace package installation with local action
ci: Use a container and expand versions
ci: Add Archlinux
ci: Add Fedora
ci: Add Alpine
This is now applied. CI results can be seen at
https://github.com/kmod-project/kmod/actions
In future we may work on import patch series submitted via mailing list to make sure all of them go through CI:
https://github.com/kmod-project/kmod/issues/52
I also added a bunch of issues in
https://github.com/kmod-project/kmod/issues, particularly for improvements. Thanks to Emil who also added some. If anyone looking to collaborate, feel free to grab one and submit patches either via mailing list or github.
With this I'm going to remove the TODO file that has been stale for a long time.
Lucas De Marchi
Quoted 15 lines
.github/actions/setup-alpine/action.yml | 22 ++++++++++ .github/actions/setup-archlinux/action.yml | 16 ++++++++ .github/actions/setup-fedora/action.yml | 27 +++++++++++++ .github/actions/setup-ubuntu/action.yml | 23 +++++++++++ .github/workflows/main.yml | 47 +++++++++++++--------- 5 files changed, 117 insertions(+), 18 deletions(-)create mode 100644
.github/actions/setup-alpine/action.ymlcreate mode 100644.github/actions/setup-archlinux/action.ymlcreate mode 100644.github/actions/setup-fedora/action.ymlcreate mode 100644.github/actions/setup-ubuntu/action.ymlSignature · 1 line
2.45.2