Skip to content

wip

wip #552

Workflow file for this run

name: CI
# Run CI when a commit lands on the main branch and when a PR for main is
# opened.
on:
push:
branches:
- main
- "**" # TODO: remove once it's mergeable
pull_request:
branches:
- main
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
DEFAULT_DISTRO: fedora-41
permissions:
contents: read
packages: write
jobs:
create-containers:
timeout-minutes: 15
strategy:
matrix:
host:
- { name: ubuntu-24.04, arch: x64 }
- { name: 4-core-ubuntu-arm, arch: arm64 }
distribution:
- { name: fedora, version: "41" }
- { name: fedora, version: "40" }
- { name: fedora, version: "39" }
- { name: ubuntu, version: "24.10" }
- { name: ubuntu, version: "24.04" }
runs-on: ["${{ matrix.host.name }}"]
name: "Prepare: ${{ matrix.distribution.name }} ${{ matrix.distribution.version }} (${{ matrix.host.arch}})"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log to GHCR
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image
id: build-and-push
uses: docker/build-push-action@v4
with:
file: .github/${{ matrix.distribution.name }}-${{ matrix.distribution.version }}.Dockerfile
push: true
tags: ghcr.io/facebook/bpfilter:${{ matrix.distribution.name }}-${{ matrix.distribution.version }}-${{ matrix.host.arch}}
cache-from: type=gha,scope=${{ matrix.distribution.name }}-${{ matrix.distribution.version }}-${{ matrix.host.arch}}
cache-to: type=gha,mode=max,scope=${{ matrix.distribution.name }}-${{ matrix.distribution.version }}-${{ matrix.host.arch}}
build:
needs: create-containers
strategy:
matrix:
host:
- name: "ubuntu-24.04"
arch: "x64"
- name: "4-core-ubuntu-arm"
arch: "arm64"
distribution:
- name: fedora
version: 41
- name: fedora
version: 40
- name: fedora
version: 39
- name: ubuntu
version: "24.04"
- name: ubuntu
version: "24.10"
runs-on: ["${{ matrix.host.name }}"]
timeout-minutes: 5
container: ghcr.io/facebook/bpfilter:${{ matrix.distribution.name }}-${{ matrix.distribution.version }}-${{ matrix.host.arch}}
name: "Build: ${{ matrix.distribution.name }} ${{ matrix.distribution.version }} (${{ matrix.host.arch}})"
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure build
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_BUILD_TYPE=release
- name: Build
run: make -C $GITHUB_WORKSPACE/build -j `nproc`
tests:
needs: create-containers
strategy:
matrix:
host:
- name: "ubuntu-24.04"
arch: "x64"
- name: "4-core-ubuntu-arm"
arch: "arm64"
runs-on: ["${{ matrix.host.name }}"]
name: "Tests: ${{ matrix.host.arch }}"
container:
image: ghcr.io/facebook/bpfilter:fedora-41-${{ matrix.host.arch }}
options: --privileged
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure build
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build
- name: Build
run: make -C $GITHUB_WORKSPACE/build -j `nproc` test
- name: Build
run: make -C $GITHUB_WORKSPACE/build -j `nproc` e2e
benchmark:
needs: create-containers
strategy:
matrix:
host:
- name: "ubuntu-24.04"
arch: "x64"
- name: "4-core-ubuntu-arm"
arch: "arm64"
runs-on: ["${{ matrix.host.name }}"]
name: "Benchmark: ${{ matrix.host.arch }}"
container:
image: ghcr.io/facebook/bpfilter:fedora-41-${{ matrix.host.arch }}
options: --privileged
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Ensure we can read the Git repository
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Configure build
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DWITH_BENCHMARK=on
- name: Build
run: make -C $GITHUB_WORKSPACE/build -j `nproc` benchmark
check:
needs: create-containers
runs-on: ["ubuntu-24.04"]
name: "Check"
container:
image: ghcr.io/facebook/bpfilter:fedora-41-x64
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure build
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build
- name: Build
run: make -C $GITHUB_WORKSPACE/build -j `nproc` check
doc:
needs: create-containers
runs-on: ["ubuntu-24.04"]
name: "Documentation"
container:
image: ghcr.io/facebook/bpfilter:fedora-41-x64
timeout-minutes: 5
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure build
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build
- name: Build
run: make -C $GITHUB_WORKSPACE/build -j `nproc` doc