summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorManuel Bentele2021-07-26 13:58:32 +0200
committerManuel Bentele2021-07-26 14:00:26 +0200
commit0cefdff96f181c28e5c11f6b5c3001dfb9b4794b (patch)
tree2cbdaac85a19871acdd3501d4c837903070e212a
parentFix build issue if version information (Git tag) is missing (diff)
downloadxloop-0cefdff96f181c28e5c11f6b5c3001dfb9b4794b.tar.gz
xloop-0cefdff96f181c28e5c11f6b5c3001dfb9b4794b.tar.xz
xloop-0cefdff96f181c28e5c11f6b5c3001dfb9b4794b.zip
Add Github actions to compile kernel module for various kernels
-rw-r--r--.github/workflows/build-kernel-modules.yml76
-rw-r--r--.github/workflows/build-program.yml (renamed from .github/workflows/build.yml)4
2 files changed, 78 insertions, 2 deletions
diff --git a/.github/workflows/build-kernel-modules.yml b/.github/workflows/build-kernel-modules.yml
new file mode 100644
index 0000000..67e42cd
--- /dev/null
+++ b/.github/workflows/build-kernel-modules.yml
@@ -0,0 +1,76 @@
+name: Build xloop kernel modules
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ release:
+
+jobs:
+ build:
+ strategy:
+ fail-fast: false
+ matrix:
+ config:
+ - name: kernel module [CentOS kernel 4.18.0-x]
+ build-os: ubuntu-20.04
+ kernel-type: centos
+ kernel-version: 4.18.0-305.10.2
+ kernel-source: https://vault.centos.org/8.4.2105/BaseOS/Source/SPackages/kernel-4.18.0-305.10.2.el8_4.src.rpm
+ - name: kernel module [Linux kernel 4.19.x]
+ build-os: ubuntu-18.04
+ kernel-type: vanilla
+ kernel-version: 4.19.y
+ - name: kernel module [Linux kernel 5.4.x]
+ build-os: ubuntu-20.04
+ kernel-type: vanilla
+ kernel-version: 5.4.y
+ - name: kernel module [Linux kernel 5.10.x]
+ build-os: ubuntu-20.04
+ kernel-type: vanilla
+ kernel-version: 5.10.y
+ name: Build xloop ${{ matrix.config.name }}
+ runs-on: ${{ matrix.config.build-os }}
+ steps:
+ - name: Install xloop dependencies
+ run: |
+ sudo apt-get update -y -qq
+ sudo apt-get install -y -qq make \
+ clang-format \
+ libelf-dev \
+ libcap-dev \
+ rpm2cpio \
+ rpm
+ - name: Checkout xloop repository
+ uses: actions/checkout@v2
+ - name: Fetch xloop repository tags
+ run: git fetch --prune --unshallow
+ - name: Checkout Vanilla kernel version
+ if: matrix.config.kernel-type == 'vanilla'
+ run: git clone --depth 1 --branch "linux-${{ matrix.config.kernel-version }}" "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git" "../kernel"
+ - name: Checkout CentOS kernel version
+ if: matrix.config.kernel-type == 'centos'
+ run: |
+ mkdir "${{ github.workspace }}/../kernel"
+ mkdir "${{ github.workspace }}/../kernel-download"
+ wget -q -O "${{ github.workspace }}/../kernel-download/kernel.rpm" "${{ matrix.config.kernel-source }}"
+ cd "${{ github.workspace }}/../kernel-download"
+ rpm2cpio "${{ github.workspace }}/../kernel-download/kernel.rpm" | cpio --extract --make-directories
+ tar --strip 1 -a -x -f linux-${{ matrix.config.kernel-version }}*.tar.xz -C "${{ github.workspace }}/../kernel"
+ - name: Configure kernel version
+ working-directory: ${{ github.workspace }}/../kernel
+ run: |
+ make defconfig
+ make modules_prepare
+ - name: Configure xloop build
+ run: |
+ cmake -B ${{ github.workspace }}/build \
+ -S ${{ github.workspace }} \
+ -D CMAKE_BUILD_TYPE=Release \
+ -D KERNEL_BUILD_DIR=${{ github.workspace }}/../kernel \
+ -D KERNEL_INSTALL_DIR=${{ github.workspace }}/../kernel/extra \
+ -D KERNEL_SCRIPTS_DIR=${{ github.workspace }}/../kernel/scripts
+ - name: Build xloop kernel modules
+ working-directory: ${{ github.workspace }}/build
+ run: make
diff --git a/.github/workflows/build.yml b/.github/workflows/build-program.yml
index 73cd4b4..69d443f 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build-program.yml
@@ -1,4 +1,4 @@
-name: Build xloop
+name: Build xloop program
on:
push:
@@ -41,4 +41,4 @@ jobs:
-D CMAKE_BUILD_TYPE=${{ matrix.config.build-type }}
- name: Build xloop artifacts
working-directory: ${{ github.workspace }}/build
- run: make
+ run: make xlosetup