Skip to content

Commit

Permalink
GitHub ci (#24)
Browse files Browse the repository at this point in the history
* Initial Github CI against linux kernels

* Fixed path for linux-next source

* Added perl-modules to Dockerfile

* Removed some old CI files and tidied things up

* Added CI for linux stable kernel

* Schedule compile checks every Monday morning at 02:00
  • Loading branch information
duncanpatterson authored Aug 14, 2023
1 parent 8cfbf84 commit 8cdf936
Show file tree
Hide file tree
Showing 13 changed files with 213 additions and 153 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/kernel-lts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: DAHDI Kernel CI for LTS kernels

on:
schedule:
- cron: 00 02 * * 1

jobs:
kernel_test:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
fail-fast: false
matrix:
kernel_branch: [
'linux-4.14.y',
'linux-4.19.y',
'linux-5.4.y',
'linux-5.10.y',
'linux-5.15.y',
'linux-6.1.y'
]
steps:
- name: Cache kernel git repo
id: cache-kernel-git
uses: actions/cache@v3
with:
path: ./linux
key: kernel-git-cache

- if: ${{ steps.cache-kernel-git.outputs.cache-hit != 'true' }}
name: Clone Kernel repo
run: git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

- name: Update kernel git
run: git fetch
working-directory: ./linux

- name: Switch to desired branch
run: git checkout ${{matrix.kernel_branch}}
working-directory: ./linux

- name: Fetch dahdi-linux
uses: actions/checkout@v3
with:
path: dahdi-linux

- name: Create build container
run: docker build ./ci -t dahdi-builder
working-directory: ./dahdi-linux

- name: Build dahdi-linux
run: "docker run -v ${PWD}/dahdi-linux:/src -v ${PWD}/linux:/linux dahdi-builder"

41 changes: 41 additions & 0 deletions .github/workflows/kernel-mainline.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: DAHDI Kernel CI for mainline kernel

on:
schedule:
- cron: 00 02 * * 1

jobs:
kernel_test:
runs-on: ubuntu-latest
steps:
- name: Cache kernel git repo
id: cache-kernel-git
uses: actions/cache@v3
with:
path: ./linux
key: kernel-mainline-git-cache

- if: ${{ steps.cache-kernel-git.outputs.cache-hit != 'true' }}
name: Clone Kernel repo
run: git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

- name: Update kernel git
run: git fetch
working-directory: ./linux

- name: Switch to desired branch
run: git checkout master
working-directory: ./linux

- name: Fetch dahdi-linux
uses: actions/checkout@v3
with:
path: dahdi-linux

- name: Create build container
run: docker build ./ci -t dahdi-builder
working-directory: ./dahdi-linux

- name: Build dahdi-linux
run: "docker run -v ${PWD}/dahdi-linux:/src -v ${PWD}/linux:/linux dahdi-builder"

41 changes: 41 additions & 0 deletions .github/workflows/kernel-next.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: DAHDI Kernel CI for linux-next

on:
schedule:
- cron: 00 02 * * 1

jobs:
kernel_test:
runs-on: ubuntu-latest
steps:
- name: Cache kernel git repo
id: cache-kernel-git
uses: actions/cache@v3
with:
path: ./linux-next
key: kernel-next-git-cache

- if: ${{ steps.cache-kernel-git.outputs.cache-hit != 'true' }}
name: Clone Kernel repo
run: git clone git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git

- name: Update kernel git
run: git fetch
working-directory: ./linux-next

- name: Switch to desired branch
run: git checkout master
working-directory: ./linux-next

- name: Fetch dahdi-linux
uses: actions/checkout@v3
with:
path: dahdi-linux

- name: Create build container
run: docker build ./ci -t dahdi-builder
working-directory: ./dahdi-linux

- name: Build dahdi-linux
run: "docker run -v ${PWD}/dahdi-linux:/src -v ${PWD}/linux-next:/linux dahdi-builder"

48 changes: 48 additions & 0 deletions .github/workflows/kernel-stable.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: DAHDI Kernel CI for Stable kernel

on:
schedule:
- cron: 00 02 * * 1

jobs:
kernel_test:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
fail-fast: false
matrix:
kernel_branch: [
'linux-6.4.y'
]
steps:
- name: Cache kernel git repo
id: cache-kernel-git
uses: actions/cache@v3
with:
path: ./linux
key: kernel-git-cache

- if: ${{ steps.cache-kernel-git.outputs.cache-hit != 'true' }}
name: Clone Kernel repo
run: git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

- name: Update kernel git
run: git fetch
working-directory: ./linux

- name: Switch to desired branch
run: git checkout ${{matrix.kernel_branch}}
working-directory: ./linux

- name: Fetch dahdi-linux
uses: actions/checkout@v3
with:
path: dahdi-linux

- name: Create build container
run: docker build ./ci -t dahdi-builder
working-directory: ./dahdi-linux

- name: Build dahdi-linux
run: "docker run -v ${PWD}/dahdi-linux:/src -v ${PWD}/linux:/linux dahdi-builder"

7 changes: 7 additions & 0 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM debian:bookworm
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install gcc make perl-modules
RUN apt-get -y install flex bison wget libssl-dev libelf-dev bc
ENTRYPOINT [ "/usr/bin/bash" ]

23 changes: 23 additions & 0 deletions ci/build-dahdi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
cd /linux
echo "### Cleaning Kernel tree"
echo " # rm .config"
rm .config

echo " # make clean"
make clean
echo "### Get kernel version"
make kernelversion
echo "### Create defconfig and prepare for module building"
echo " # make x86_64_defconfig"
make x86_64_defconfig
echo " # make modules_prepare"
make modules_prepare

echo "### Building DAHDI modules and installing"
cd /src
echo " # make clean"
make clean
echo " # make install KSRC=/linux"
make install KSRC=/linux

57 changes: 0 additions & 57 deletions docker-compose.yml

This file was deleted.

10 changes: 0 additions & 10 deletions test/docker/centos6

This file was deleted.

10 changes: 0 additions & 10 deletions test/docker/centos7

This file was deleted.

12 changes: 0 additions & 12 deletions test/docker/debianstable

This file was deleted.

12 changes: 0 additions & 12 deletions test/docker/debiantesting

This file was deleted.

11 changes: 0 additions & 11 deletions test/docker/fedorarawhide

This file was deleted.

41 changes: 0 additions & 41 deletions test/test-build.sh

This file was deleted.

0 comments on commit 8cdf936

Please sign in to comment.