-
Notifications
You must be signed in to change notification settings - Fork 31
132 lines (123 loc) · 4.16 KB
/
ci.yaml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
name: Testing on CI
on:
push:
branches:
- "**"
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
permissions:
contents: read
packages: write
jobs:
create-container:
strategy:
matrix:
host:
- name: "ubuntu-24.04"
arch: "x64"
- name: "4-core-ubuntu-arm"
arch: "arm64"
distribution:
- name: fedora
version: "41"
runs-on: ["${{ matrix.host.name }}"]
name: "${{ 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 into container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push container image
id: build-and-push
uses: docker/build-push-action@v4
with:
file: tools/${{ matrix.distribution.name }}-${{ matrix.distribution.version }}.Dockerfile
push: true
tags: ghcr.io/facebook/bpfilter:${{ matrix.distribution.name }}-${{ matrix.distribution.version }}-${{ matrix.host.arch}}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build:
needs: create-container
strategy:
matrix:
host:
- name: "ubuntu-24.04"
arch: "x64"
- name: "4-core-ubuntu-arm"
arch: "arm64"
distribution:
- name: fedora
version: "41"
runs-on: ["${{ matrix.host.name }}"]
container: ghcr.io/facebook/bpfilter:${{ 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=debug
- name: Build
run: make -C $GITHUB_WORKSPACE/build -j `nproc` bpfilter libbpfilter bfcli
check:
needs: create-container
runs-on: ["4-core-ubuntu-arm"]
container: ghcr.io/facebook/bpfilter:fedora-41-arm64
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure build
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_BUILD_TYPE=debug
- name: Check
run: make -C $GITHUB_WORKSPACE/build -j `nproc` check
tests:
needs: create-container
runs-on: ["4-core-ubuntu-arm"]
container:
image: ghcr.io/facebook/bpfilter:fedora-41-arm64
options: --privileged
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure build
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_BUILD_TYPE=debug
- name: Check
run: make -C $GITHUB_WORKSPACE/build -j `nproc` test
- name: Test
run: make -C $GITHUB_WORKSPACE/build -j `nproc` e2e
documentation:
needs: create-container
runs-on: ["4-core-ubuntu-arm"]
container: ghcr.io/facebook/bpfilter:fedora-41-arm64
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure build
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_BUILD_TYPE=debug
- name: Generate documentation
run: make -C $GITHUB_WORKSPACE/build -j `nproc` doc
integration:
needs: create-container
strategy:
matrix:
tool: [iptables, nftables]
runs-on: ["4-core-ubuntu-arm"]
container: ghcr.io/facebook/bpfilter:fedora-41-arm64
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Configure build
run: cmake -S $GITHUB_WORKSPACE -B $GITHUB_WORKSPACE/build -DCMAKE_BUILD_TYPE=debug
- name: Build
run: make -C $GITHUB_WORKSPACE/build -j `nproc` ${{ matrix.tool }}