forked from facebook/bpfilter
-
Notifications
You must be signed in to change notification settings - Fork 2
119 lines (111 loc) · 3.46 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
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:
distribution:
- fedora
- ubuntu
machine:
- ubuntu-latest
- 4-core-ubuntu-arm
include:
- machine: ubuntu-latest
arch: x64
- machine: 4-core-ubuntu-arm
arch: arm64
- distribution: fedora
version: 39
- distribution: fedora
version: 40
- distribution: fedora
version: 41
- distribution: ubuntu
version: 24.04
- distribution: ubuntu
version: 24.10
runs-on: ["${{ matrix.machine }}"]
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:
context: "{{defaultContext}}:tools"
push: true
tags: ${{ env.IMAGE_NAME }}:${{ matrix.distribution }}-${{ matrix.version }}-${{ matrix.arch }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build:
needs: create-container
strategy:
fail-fast: false
matrix:
host: ["ubuntu-latest", "4-core-ubuntu-arm"]
runs-on: ["${{matrix.host}}"]
container: ghcr.io/facebook/bpfilter/fedora:41
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
test:
needs: create-container
container: ghcr.io/facebook/bpfilter/fedora:41
runs-on: ["ubuntu-latest"]
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` test
checkstyle:
needs: create-container
container: ghcr.io/facebook/bpfilter/fedora:41
runs-on: ["ubuntu-latest"]
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` check
documentation:
needs: create-container
container: ghcr.io/facebook/bpfilter/fedora:41
runs-on: ["ubuntu-latest"]
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` doc