Repository navigation
72 lines (59 loc) · 2.75 KB
/
Copy pathci.yml
File metadata and controls
72 lines (59 loc) · 2.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# Build homa.ko and run the unit tests against a configured Linux tree.
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
build-and-test:
runs-on: ubuntu-24.04
env:
LINUX_VERSION: 6.17.8
# The base for checkpatch: a pull request's base, or the branch tip before a push.
BASE_SHA: ${{ github.event.pull_request.base.sha || github.event.before }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0 # the strip check needs a pull request's base
- name: Install kernel build dependencies
run: sudo apt-get update && sudo apt-get install -y flex bison bc libelf-dev libssl-dev codespell
# The unit tests compile against kernel headers, which need a
# configured tree; modules_prepare is enough, no vmlinux.
- name: Prepare Linux ${{ env.LINUX_VERSION }}
run: |
curl -sSL https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-$LINUX_VERSION.tar.xz | tar xJ -C $RUNNER_TEMP
cd $RUNNER_TEMP/linux-$LINUX_VERSION
make defconfig
# Options the unit tests' mocks assume.
scripts/config -e PREEMPT -e DEBUG_PREEMPT -e SECURITY -e SECURITY_NETWORK -d RANDOM_KMALLOC_CACHES
make olddefconfig
make -j$(nproc) modules_prepare
echo "KDIR=$PWD" >> $GITHUB_ENV
# Without vmlinux there is no Module.symvers, so modpost can't
# resolve kernel symbols; report those as warnings.
- name: Build homa.ko
run: make KBUILD_MODPOST_WARN=1
# Build only: running these tools needs a loaded Homa module.
- name: Build util
run: make -C util -j$(nproc)
- name: Unit tests (IPv6)
run: make -C test -j$(nproc) unit && cd test && ./unit
- name: Unit tests (IPv4)
if: ${{ !cancelled() }}
run: cd test && ./unit --ipv4
# The stripped version (__STRIP__=1), with the same kernel.
- name: Build homa.ko (stripped)
if: ${{ !cancelled() }}
run: make KBUILD_MODPOST_WARN=1 __STRIP__=1
# Clean first: both versions of the unit tests use the same object files.
- name: Unit tests, stripped (IPv6)
if: ${{ !cancelled() }}
run: make -C test clean && make -C test -j$(nproc) __STRIP__=1 unit && cd test && ./unit
- name: Unit tests, stripped (IPv4)
if: ${{ !cancelled() }}
run: cd test && ./unit --ipv4
# checkpatch the change of a pull request or push (see the script):
# the module sources as they are, then the files that go upstream.
- name: checkpatch
if: ${{ !cancelled() }}
run: .github/scripts/checkpatch.sh "$BASE_SHA" $KDIR
- name: checkpatch (stripped)
if: ${{ !cancelled() }}
run: .github/scripts/checkpatch.sh "$BASE_SHA" $KDIR stripped