Skip to content

Commit 62c5f4f

Browse files
committed
Add clang test workflow
1 parent 410af26 commit 62c5f4f

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

.github/workflows/tests.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,61 @@ jobs:
141141

142142
- name: Remove the test module
143143
run: sudo dkms remove --all -m dkms_test -v 1.0
144+
145+
test-vm-clang:
146+
name: Test in Ubuntu VM with clang
147+
strategy:
148+
matrix:
149+
version:
150+
- 22.04
151+
runs-on: ubuntu-${{ matrix.version }}
152+
153+
steps:
154+
- uses: actions/checkout@v3
155+
156+
- name: Install dependencies
157+
run: |
158+
sudo apt update -q
159+
sudo apt install -qqy make libc6-dev llvm clang lld llvm-11 clang-11 lld-11 llvm-14 clang-14 lld-14 flex bison libssl-dev openssl
160+
161+
- name: Remove apport
162+
run: |
163+
sudo apt remove -qqy apport
164+
165+
- name: Build tiny kernels with clang
166+
run: |
167+
sudo apt install linux-source-5.19.0
168+
tar -C /tmp -xf /usr/src/linux-source-5.19.0.tar.bz2
169+
cd /tmp/linux-source-5.19.0
170+
# make `make clean` happy
171+
mkdir ubuntu/hio
172+
touch ubuntu/hio/Makefile
173+
# LLVM=-version is supported since 5.18
174+
make LLVM=-11 tinyconfig
175+
echo "CONFIG_MODULES=y" >> .config
176+
echo "CONFIG_MODULE_SIG=y" >> .config
177+
echo "CONFIG_MODULE_SIG_SHA1=y" >> .config
178+
echo "CONFIG_MODULE_SIG_HASH=\"sha1\"" >> .config
179+
sed -i 's/^CONFIG_LOCALVERSION=.*$/CONFIG_LOCALVERSION="-clang11"/' .config
180+
yes $'\n' | make LLVM=-11
181+
sudo make modules_install
182+
sudo make install
183+
make clean
184+
make LLVM=-14 tinyconfig
185+
echo "CONFIG_MODULES=y" >> .config
186+
echo "CONFIG_MODULE_SIG=y" >> .config
187+
echo "CONFIG_MODULE_SIG_SHA512=y" >> .config
188+
echo "CONFIG_MODULE_SIG_HASH=\"sha512\"" >> .config
189+
sed -i 's/^CONFIG_LOCALVERSION=.*$/CONFIG_LOCALVERSION="-clang14"/' .config
190+
yes $'\n' | make LLVM=-14
191+
sudo make modules_install
192+
sudo make install
193+
194+
- name: Install dkms
195+
run: sudo make install
196+
197+
- name: Run tests
198+
run: |
199+
KERNEL_VER="$(cd /tmp/linux-source-5.19.0 && make kernelversion)"
200+
sudo env KERNEL_VER="${KERNEL_VER}-clang11" ./run_test.sh
201+
sudo env KERNEL_VER="${KERNEL_VER}-clang14" ./run_test.sh

0 commit comments

Comments
 (0)