Skip to content

Commit 6b984f3

Browse files
committed
wip
1 parent 840573c commit 6b984f3

File tree

1 file changed

+125
-4
lines changed

1 file changed

+125
-4
lines changed

.github/workflows/ci.yaml

Lines changed: 125 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,101 @@ permissions:
2121
packages: write
2222

2323
jobs:
24+
create-containers:
25+
timeout-minutes: 15
26+
strategy:
27+
matrix:
28+
host:
29+
- { name: ubuntu-24.04, arch: x64 }
30+
- { name: 4-core-ubuntu-arm, arch: arm64 }
31+
distribution:
32+
- { name: fedora, version: "41" }
33+
- { name: fedora, version: "40" }
34+
- { name: fedora, version: "39" }
35+
- { name: ubuntu, version: "24.10" }
36+
- { name: ubuntu, version: "24.04" }
37+
runs-on: ["${{ matrix.host.name }}"]
38+
name: "Prepare: ${{ matrix.distribution.name }} ${{ matrix.distribution.version }} (${{ matrix.host.arch}})"
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v2
42+
- name: Set up Docker Buildx
43+
uses: docker/setup-buildx-action@v3
44+
- name: Log to GHCR
45+
uses: docker/login-action@v2
46+
with:
47+
registry: ${{ env.REGISTRY }}
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
- name: Build and push container image
51+
id: build-and-push
52+
uses: docker/build-push-action@v4
53+
with:
54+
file: .github/${{ matrix.distribution.name }}-${{ matrix.distribution.version }}.Dockerfile
55+
push: true
56+
tags: ghcr.io/facebook/bpfilter:${{ matrix.distribution.name }}-${{ matrix.distribution.version }}-${{ matrix.host.arch}}
57+
cache-from: type=gha,scope=${{ matrix.distribution.name }}-${{ matrix.distribution.version }}-${{ matrix.host.arch}}
58+
cache-to: type=gha,mode=max,scope=${{ matrix.distribution.name }}-${{ matrix.distribution.version }}-${{ matrix.host.arch}}
59+
60+
build:
61+
needs: create-containers
62+
strategy:
63+
matrix:
64+
host:
65+
- name: "ubuntu-24.04"
66+
arch: "x64"
67+
- name: "4-core-ubuntu-arm"
68+
arch: "arm64"
69+
distribution:
70+
- name: fedora
71+
version: 41
72+
- name: fedora
73+
version: 40
74+
- name: fedora
75+
version: 39
76+
- name: ubuntu
77+
version: "24.04"
78+
- name: ubuntu
79+
version: "24.10"
80+
runs-on: ["${{ matrix.host.name }}"]
81+
timeout-minutes: 5
82+
container: ghcr.io/facebook/bpfilter:${{ matrix.distribution.name }}-${{ matrix.distribution.version }}-${{ matrix.host.arch}}
83+
name: "Build: ${{ matrix.distribution.name }} ${{ matrix.distribution.version }} (${{ matrix.host.arch}})"
84+
steps:
85+
- name: Checkout repository
86+
uses: actions/checkout@v2
87+
- name: Configure build
88+
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_BUILD_TYPE=release
89+
- name: Build
90+
run: make -C $GITHUB_WORKSPACE/build -j `nproc`
91+
92+
tests:
93+
needs: create-containers
94+
strategy:
95+
matrix:
96+
host:
97+
- name: "ubuntu-24.04"
98+
arch: "x64"
99+
- name: "4-core-ubuntu-arm"
100+
arch: "arm64"
101+
runs-on: ["${{ matrix.host.name }}"]
102+
name: "Tests: ${{ matrix.host.arch }}"
103+
container:
104+
image: ghcr.io/facebook/bpfilter:fedora-41-${{ matrix.host.arch }}
105+
options: --privileged
106+
timeout-minutes: 5
107+
steps:
108+
- name: Checkout repository
109+
uses: actions/checkout@v2
110+
- name: Configure build
111+
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build
112+
- name: Build
113+
run: make -C $GITHUB_WORKSPACE/build -j `nproc` test
114+
- name: Build
115+
run: make -C $GITHUB_WORKSPACE/build -j `nproc` e2e
24116

25117
benchmark:
118+
needs: create-containers
26119
strategy:
27120
matrix:
28121
host:
@@ -39,11 +132,39 @@ jobs:
39132
steps:
40133
- name: Checkout repository
41134
uses: actions/checkout@v2
135+
- name: Ensure we can read the Git repository
136+
run: git config --global --add safe.directory $GITHUB_WORKSPACE
42137
- name: Configure build
43138
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DWITH_BENCHMARK=on
44-
- name: test
45-
run: ls -lha $GITHUB_WORKSPACE; ls -lha $GITHUB_WORKSPACE/build; id
46-
- name: testt
47-
run: git config --global --add safe.directory $GITHUB_WORKSPACE
48139
- name: Build
49140
run: make -C $GITHUB_WORKSPACE/build -j `nproc` benchmark
141+
142+
check:
143+
needs: create-containers
144+
runs-on: ["ubuntu-24.04"]
145+
name: "Check"
146+
container:
147+
image: ghcr.io/facebook/bpfilter:fedora-41-x64
148+
timeout-minutes: 5
149+
steps:
150+
- name: Checkout repository
151+
uses: actions/checkout@v2
152+
- name: Configure build
153+
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build
154+
- name: Build
155+
run: make -C $GITHUB_WORKSPACE/build -j `nproc` check
156+
157+
doc:
158+
needs: create-containers
159+
runs-on: ["ubuntu-24.04"]
160+
name: "Documentation"
161+
container:
162+
image: ghcr.io/facebook/bpfilter:fedora-41-x64
163+
timeout-minutes: 5
164+
steps:
165+
- name: Checkout repository
166+
uses: actions/checkout@v2
167+
- name: Configure build
168+
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build
169+
- name: Build
170+
run: make -C $GITHUB_WORKSPACE/build -j `nproc` doc

0 commit comments

Comments
 (0)