ci/push: I forgor #338
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Push actions | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
test: | |
name: Run tests with ${{ matrix.flags.flags }} ${{ matrix.flags.args }} | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
flags: | |
- flags: CHECKSUM_HACK=kfunc | |
args: '' | |
desc: kfunc | |
- flags: CHECKSUM_HACK=kfunc USE_LIBXDP=1 | |
args: '' | |
desc: kfunc-libxdp-use-libbpf | |
- flags: CHECKSUM_HACK=kfunc USE_LIBXDP=1 | |
args: --use-libxdp | |
desc: kfunc-libxdp-use-libxdp | |
- flags: CHECKSUM_HACK=kprobe STRIP_BTF_EXT=1 | |
args: '' | |
desc: kprobe-strip-btf-ext | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt install python3 clang-15 llvm pahole \ | |
bats bc conntrack ethtool iperf3 jq socat tshark wireguard-tools \ | |
libbpf-dev libffi-dev libelf-dev libxdp-dev | |
- name: Build & Test | |
run: | | |
export BPF_CC=clang-15 | |
sudo cp /sys/kernel/btf/vmlinux /lib/modules/`uname -r`/build | |
make -j ${{ matrix.flags.flags }} | |
sudo nft delete table filter # Docker's nftables rule drops IPv4 packets in tests | |
sudo insmod out/mimic.ko | |
sudo env MIMIC_TEST_EXTRA_ARGS=\"${{ matrix.flags.args }}\" make test ${{ matrix.flags.flags }} | |
- name: Upload captured packets | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: pcap-${{ matrix.flags.desc }} | |
path: out/*.pcapng | |
build-deb: | |
name: Build .deb packages for ${{ matrix.distro.name }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
distro: | |
- name: Debian 12 | |
codename: bookworm | |
image: debian:bookworm-slim | |
- name: Ubuntu 24.04 | |
codename: noble | |
image: ubuntu:noble | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build | |
uses: jtdor/build-deb-action@v1 | |
with: | |
buildpackage-opts: -b -us -uc | |
docker-image: ${{ matrix.distro.image }} | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.distro.codename }}-packages | |
path: | | |
debian/artifacts/*.deb | |
debian/artifacts/*.ddeb | |
test-deb-install: | |
name: Test .deb installation | |
needs: build-deb | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: noble-packages | |
path: noble-packages | |
- name: Test Install | |
run: | | |
sudo apt install ./noble-packages/*.deb linux-headers-`uname -r` | |
sudo modprobe mimic |