|
1 | | -name: Push actions |
| 1 | +name: Run tests in LVH |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
| 5 | + paths: |
| 6 | + - .github/workflows/test.yml |
| 7 | + - "**.c" |
| 8 | + - "**.h" |
| 9 | + - "**/Makefile" |
| 10 | + # - tests/** |
| 11 | + - "!tools/**" |
5 | 12 | pull_request: |
6 | 13 | workflow_dispatch: |
7 | 14 |
|
8 | 15 | jobs: |
9 | | - test: |
10 | | - name: Run tests with ${{ matrix.flags.flags }} ${{ matrix.flags.args }} |
11 | | - runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} |
12 | | - strategy: |
13 | | - fail-fast: false |
14 | | - matrix: |
15 | | - arch: [amd64] # TODO: arm64 (bpftool not working) |
16 | | - flags: |
17 | | - - flags: CHECKSUM_HACK=kfunc |
18 | | - args: "" |
19 | | - desc: kfunc |
20 | | - - flags: CHECKSUM_HACK=kfunc USE_LIBXDP=0 |
21 | | - args: "" |
22 | | - desc: kfunc-no-libxdp |
23 | | - - flags: CHECKSUM_HACK=kfunc USE_LIBXDP=1 |
24 | | - args: "" |
25 | | - desc: kfunc-libxdp-use-libbpf |
26 | | - - flags: CHECKSUM_HACK=kfunc USE_LIBXDP=1 |
27 | | - args: --use-libxdp |
28 | | - desc: kfunc-libxdp-use-libxdp |
29 | | - - flags: CHECKSUM_HACK=kprobe STRIP_BTF_EXT=1 |
30 | | - args: "" |
31 | | - desc: kprobe-strip-btf-ext |
32 | | - steps: |
33 | | - - name: Checkout |
34 | | - uses: actions/checkout@v4 |
35 | | - - name: Install dependencies |
36 | | - run: | |
37 | | - sudo apt update |
38 | | - sudo apt install python3 clang-15 llvm pahole \ |
39 | | - linux-tools-common linux-tools-$(uname -r) linux-cloud-tools-$(uname -r) \ |
40 | | - libbpf-dev libffi-dev libelf-dev libxdp-dev \ |
41 | | - bats bc conntrack ethtool iperf3 jq socat tshark wireguard-tools |
42 | | - - name: Build & Test |
43 | | - run: | |
44 | | - export BPF_CC=clang-15 |
45 | | - sudo cp /sys/kernel/btf/vmlinux /lib/modules/$(uname -r)/build |
46 | | - make -j ${{ matrix.flags.flags }} |
47 | | - sudo nft delete table filter # Docker's nftables rule drops IPv4 packets in tests |
48 | | - sudo nft list ruleset |
49 | | - sudo insmod out/mimic.ko |
50 | | - sudo env MIMIC_TEST_EXTRA_ARGS="${{ matrix.flags.args }}" make test ${{ matrix.flags.flags }} |
51 | | - - name: Upload captured packets |
52 | | - uses: actions/upload-artifact@v4 |
53 | | - if: always() |
54 | | - with: |
55 | | - name: pcap-${{ matrix.flags.desc }} |
56 | | - path: out/*.pcapng |
57 | | - |
58 | | - build-deb: |
59 | | - name: Build .deb packages for ${{ matrix.distro.name }} |
60 | | - runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} |
61 | | - strategy: |
62 | | - fail-fast: false |
63 | | - matrix: |
64 | | - arch: [amd64, arm64] |
65 | | - distro: |
66 | | - - name: Debian 12 |
67 | | - codename: bookworm |
68 | | - image: debian:bookworm-slim |
69 | | - extra-repos: | |
70 | | - deb http://deb.debian.org/debian bookworm-backports main |
71 | | - extra-cmd: | |
72 | | - sed -i 's/clang/clang-16/' debian/control |
73 | | - sed -i 's/BPF_CC=clang/BPF_CC=clang-16 COMPAT_LINUX_6_1=1/' debian/rules |
74 | | - - name: Debian 13 |
75 | | - codename: trixie |
76 | | - image: debian:trixie-slim |
77 | | - - name: Debian 14 (testing) |
78 | | - codename: forky |
79 | | - image: debian:forky-slim |
80 | | - - name: Debian sid |
81 | | - codename: sid |
82 | | - image: debian:sid-slim |
83 | | - - name: Ubuntu 24.04 |
84 | | - codename: noble |
85 | | - image: ubuntu:noble |
86 | | - extra-repos-amd64: | |
87 | | - deb http://archive.ubuntu.com/ubuntu noble-backports main restricted universe multiverse |
88 | | - extra-repos-arm64: | |
89 | | - deb http://ports.ubuntu.com/ubuntu-ports noble-backports main restricted universe multiverse |
90 | | - extra-cmd: | |
91 | | - sed -i 's/clang,/clang, llvm,/' debian/control |
92 | | - steps: |
93 | | - - name: Checkout |
94 | | - uses: actions/checkout@v4 |
95 | | - - name: Run pre-building script |
96 | | - run: | |
97 | | - ${{ matrix.distro.extra-cmd }} |
98 | | - ${{ matrix.arch == 'arm64' && matrix.distro.extra-cmd-arm64 || matrix.distro.extra-cmd-amd64 }} |
99 | | - - name: Build |
100 | | - uses: jtdor/build-deb-action@v1 |
101 | | - with: |
102 | | - buildpackage-opts: -b -us -uc |
103 | | - docker-image: ${{ matrix.distro.image }} |
104 | | - extra-repos: | |
105 | | - ${{ matrix.distro.extra-repos }} |
106 | | - ${{ matrix.arch == 'arm64' && matrix.distro.extra-repos-arm64 || matrix.distro.extra-repos-amd64 }} |
107 | | - - name: Upload |
108 | | - uses: actions/upload-artifact@v4 |
109 | | - with: |
110 | | - name: packages-${{ matrix.distro.codename }}-${{ matrix.arch }} |
111 | | - path: | |
112 | | - debian/artifacts/*.deb |
113 | | - debian/artifacts/*.ddeb |
114 | | -
|
115 | | - test-deb-install: |
116 | | - name: Test .deb installation |
117 | | - needs: build-deb |
118 | | - runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} |
119 | | - strategy: |
120 | | - fail-fast: false |
121 | | - matrix: |
122 | | - arch: [amd64, arm64] |
123 | | - steps: |
124 | | - - name: Checkout |
125 | | - uses: actions/checkout@v4 |
126 | | - - name: Download artifact |
127 | | - uses: actions/download-artifact@v4 |
128 | | - with: |
129 | | - name: packages-noble-${{ matrix.arch }} |
130 | | - path: packages-noble-${{ matrix.arch }} |
131 | | - - name: Test Install |
132 | | - run: | |
133 | | - sudo apt install ./packages-noble-${{ matrix.arch }}/*.deb linux-headers-`uname -r` |
134 | | - sudo modprobe mimic |
135 | | - - name: Upload log |
136 | | - if: always() |
137 | | - uses: actions/upload-artifact@v4 |
138 | | - with: |
139 | | - name: dkms-make-log |
140 | | - path: /var/lib/dkms/mimic/*/build/make.log |
141 | | - |
142 | 16 | build-exe: |
143 | 17 | name: Build Mimic CLI executable |
144 | 18 | runs-on: ${{ matrix.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-24.04' }} |
|
0 commit comments