Skip to content

Commit 49298b3

Browse files
committed
feat(ci): test mimic with multiple clang versions in LVH
1 parent ca80c79 commit 49298b3

File tree

1 file changed

+36
-16
lines changed

1 file changed

+36
-16
lines changed

.github/workflows/push.yml

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -146,31 +146,47 @@ jobs:
146146
fail-fast: false
147147
matrix:
148148
arch: [amd64] # TODO: arm64 (bpftool not working)
149-
flags:
150-
- name: generic
151-
flags: ""
152-
- name: compat-6.1
153-
flags: COMPAT_LINUX_6_1=1
154-
- name: compat-6.6
155-
flags: COMPAT_LINUX_6_6=1
156149
steps:
157150
- name: Checkout
158151
uses: actions/checkout@v4
159-
- name: Install dependencies
152+
- name: Add LLVM apt repository
153+
shell: bash
160154
run: |
155+
wget https://apt.llvm.org/llvm.sh
156+
chmod +x llvm.sh
157+
# Ubuntu 24.04 officially packages LLVM 15 and 16
158+
for _clang_version in {17..21}; do
159+
sudo ./llvm.sh $_clang_version
160+
done
161161
sudo apt update
162-
sudo apt install clang-15 llvm pahole \
162+
- name: Install dependencies
163+
shell: bash
164+
run: |
165+
sudo apt install clang-{15..21} pahole \
163166
linux-tools-common linux-tools-$(uname -r) linux-cloud-tools-$(uname -r) \
164167
libbpf-dev libffi-dev libelf-dev libxdp-dev
165168
- name: Build CLI
169+
shell: bash
166170
run: |
167-
export BPF_CC=clang-15
168-
make build-cli -j ${{ matrix.flags.flags }}
171+
flags_name=(generic compat-6.1 compat-6.6)
172+
flags=("" "COMPAT_LINUX_6_1=1" "COMPAT_LINUX_6_6=1")
173+
for _i in {0..2}; do
174+
for _clang_version in {15..21}; do
175+
export BPF_CC=clang-$_clang_version
176+
make build-cli -j ${flags[$_i]}
177+
mv out/mimic out/mimic-${flags_name[$_i]}-clang-$_clang_version
178+
done
179+
done
180+
cd out
181+
mkdir expect-fail
182+
mv mimic-compat-6.1-clang-20 mimic-compat-6.6-clang-20 expect-fail/
169183
- name: Upload executable
170184
uses: actions/upload-artifact@v4
171185
with:
172-
name: mimic-${{ matrix.flags.name }}-${{ matrix.arch }}
173-
path: out/mimic
186+
name: mimic-${{ matrix.arch }}
187+
path: |
188+
out/mimic-*
189+
out/expect-fail/mimic-*
174190
175191
test-lvh:
176192
name: Test LVH
@@ -198,7 +214,7 @@ jobs:
198214
- name: Download artifact
199215
uses: actions/download-artifact@v4
200216
with:
201-
name: mimic-${{ matrix.kernel.variant }}-${{ matrix.arch }}
217+
name: mimic-${{ matrix.arch }}
202218
path: out
203219
- name: Install LVH CLI
204220
uses: ./.github/actions/lvh-install-cli
@@ -303,8 +319,12 @@ jobs:
303319
uname -a
304320
cd /host
305321
insmod kmod/mimic.ko
306-
chmod +x out/mimic
307-
out/mimic run lo --check
322+
cd out
323+
chmod +x mimic-*
324+
for _mimic in ./mimic-${{ matrix.kernel.variant }}-*; do
325+
echo Checking \$_mimic
326+
\$_mimic run lo --check
327+
done
308328
- name: Extract kernel log
309329
if: always()
310330
uses: ./.github/actions/lvh-run

0 commit comments

Comments
 (0)