Skip to content

Commit 7daa064

Browse files
committed
github actions: Add build check action
LE-2898 In order to test build the kernel using a centos 7 userspace, we use the rinse tool to create a centos 7 chroot using vault packages. We configure yum to pull packages from vault as well and download the required build tools. Then we do the same configure and build steps as our other github build checks, except they are run inside the chroot.
1 parent 1e3f14a commit 7daa064

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: x86_64 CI
2+
on:
3+
pull_request:
4+
branches:
5+
- '**'
6+
- '!mainline'
7+
8+
jobs:
9+
kernel-build-job:
10+
runs-on:
11+
labels: kernel-build
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
ref: "${{ github.event.pull_request.head.sha }}"
17+
fetch-depth: 0
18+
path: kernel-src-tree
19+
20+
- name: Install rinse
21+
run: |
22+
sudo apt-get install rinse
23+
24+
- name: Build centos7 chroot
25+
run: |
26+
sudo rinse --distribution centos-7 \
27+
--mirror http://dl.rockylinux.org/vault/centos/7/os/x86_64/Packages \
28+
--arch amd64 \
29+
--directory centos-7-chroot
30+
31+
- name: Point yum to vault (in chroot)
32+
run: |
33+
sudo sed -e '/mirrorlist=.*/d' \
34+
-e 's/#baseurl=/baseurl=/' \
35+
-e "s/\$releasever/7.9.2009/g" \
36+
-e "s/mirror.centos.org/dl.rockylinux.org\/vault/g" \
37+
-i centos-7-chroot/etc/yum.repos.d/CentOS-Base.repo
38+
39+
- name: Install tools and Libraries (in chroot)
40+
run: |
41+
sudo chroot centos-7-chroot yum groupinstall 'Development Tools' -y
42+
sudo chroot centos-7-chroot yum install bc dwarves git glibc-devel hostname kernel-devel mpfr openssl openssl-devel elfutils-libelf-devel -y
43+
44+
- name: Build the Kernel (in chroot)
45+
run: |
46+
sudo mv kernel-src-tree centos-7-chroot
47+
sudo chroot centos-7-chroot sh -c "cd kernel-src-tree && cp configs/kernel-3.10.0-x86_64.config .config"
48+
sudo chroot centos-7-chroot sh -c "cd kernel-src-tree && make olddefconfig"
49+
sudo chroot centos-7-chroot sh -c "cd kernel-src-tree && make -j$(nproc)"

0 commit comments

Comments
 (0)