This repository has been archived by the owner on Jul 19, 2024. It is now read-only.
forked from falcosecurity/libs
-
Notifications
You must be signed in to change notification settings - Fork 3
210 lines (179 loc) · 7.56 KB
/
ci.yml
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: CI Build
on:
pull_request:
branches: [master]
push:
branches: [master]
workflow_dispatch:
jobs:
build-libs-linux-amd64:
name: build-libs-linux-amd64 😁
strategy:
matrix:
name: [system_deps, bundled_deps, system_deps_w_chisels, system_deps_minimal]
include:
- name: system_deps
cmake_opts: -DBUILD_BPF=On -DUSE_BUNDLED_DEPS=False
- name: bundled_deps
cmake_opts: -DBUILD_BPF=On -DUSE_BUNDLED_DEPS=True
- name: system_deps_w_chisels
cmake_opts: -DBUILD_BPF=On -DUSE_BUNDLED_DEPS=False -DWITH_CHISEL=True
- name: system_deps_minimal
cmake_opts: -DUSE_BUNDLED_DEPS=False -DMINIMAL_BUILD=True
runs-on: ubuntu-latest
container:
image: debian:buster
steps:
- name: Install deps ⛓️
run: |
apt update && apt install -y --no-install-recommends ca-certificates cmake build-essential git clang llvm pkg-config autoconf automake libtool libelf-dev wget libb64-dev libc-ares-dev libcurl4-openssl-dev libssl-dev libtbb-dev libjq-dev libjsoncpp-dev libgrpc++-dev protobuf-compiler-grpc libgtest-dev libprotobuf-dev liblua5.1-dev linux-headers-amd64
- name: Checkout Libs ⤵️
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install valijson dep ⛓️
run: |
.github/install-valijson.sh
- name: Build and test 🏗️🧪
run: |
mkdir -p build
cd build && cmake ${{ matrix.cmake_opts }} ../
KERNELDIR=/lib/modules/$(ls /lib/modules)/build make -j4
make run-unit-tests
build-libs-others-amd64:
name: build-libs-others-amd64 😨
strategy:
matrix:
os: [windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Libs ⤵️
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Build and test 🏗️🧪
run: |
mkdir -p build
cd build && cmake -DCREATE_TEST_TARGETS=OFF -DMINIMAL_BUILD=true ..
cmake --build .
build-libs-arm64:
name: build-libs-arm64 🥶 (system_deps)
runs-on: ubuntu-latest
steps:
- name: Checkout Libs ⤵️
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: uraimo/[email protected]
name: Run aarch64 build 🏎️
with:
arch: aarch64
distro: buster
githubToken: ${{ github.token }}
install: |
apt update && apt install -y --no-install-recommends ca-certificates cmake build-essential clang llvm git pkg-config autoconf automake libtool libelf-dev wget libb64-dev libc-ares-dev libcurl4-openssl-dev libssl-dev libtbb-dev libjq-dev libjsoncpp-dev libgrpc++-dev protobuf-compiler-grpc libgtest-dev libprotobuf-dev linux-headers-arm64
run: |
git config --global --add safe.directory ${{ github.workspace }}
.github/install-valijson.sh
mkdir -p build
cd build && cmake -DBUILD_BPF=On -DUSE_BUNDLED_DEPS=False ../
KERNELDIR=/lib/modules/$(ls /lib/modules)/build make -j4
make run-unit-tests
build-libs-s390x:
name: build-libs-s390x 😁 (system_deps)
runs-on: ubuntu-latest
steps:
- name: Checkout Libs ⤵️
uses: actions/checkout@v3
- uses: uraimo/[email protected]
name: Run s390x build 🏗️
with:
arch: s390x
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt update && apt install -y --no-install-recommends ca-certificates cmake build-essential clang llvm git pkg-config autoconf automake libtool libelf-dev wget libb64-dev libc-ares-dev libcurl4-openssl-dev libssl-dev libtbb-dev libjq-dev libjsoncpp-dev libgrpc++-dev protobuf-compiler-grpc libgtest-dev libprotobuf-dev linux-headers-generic
run: |
git config --global --add safe.directory ${{ github.workspace }}
.github/install-valijson.sh
mkdir -p build
cd build && cmake -DBUILD_BPF=On -DUSE_BUNDLED_DEPS=False ../
KERNELDIR=/lib/modules/$(ls /lib/modules)/build make -j4
make run-unit-tests
build-and-test-modern-bpf-x86:
name: build-and-test-modern-bpf-x86 😇 (bundled_deps)
runs-on: ubuntu-22.04
steps:
- name: Checkout Libs ⤵️
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install deps ⛓️
run: |
sudo apt update
sudo apt install -y --no-install-recommends ca-certificates cmake build-essential clang-14 git pkg-config autoconf automake libtool libelf-dev libcap-dev
- name: Build scap-open 🏗️
run: |
mkdir -p build
cd build && cmake -DUSE_BUNDLED_DEPS=ON -DUSE_MODERN_BPF=ON -DBUILD_MODERN_BPF_TEST=ON -DMODERN_BPF_DEBUG_MODE=ON -DBUILD_LIBSCAP_GVISOR=OFF ../
make scap-open
- name: Run scap-open 🏎️
run: |
cd build
sudo ./libscap/examples/01-open/scap-open --modern_bpf --num_events 0
- name: Build bpf_test 🏗️
run: |
cd build
make bpf_test
- name: Running tests 🧪
run: |
cd build
sudo ./test/modern_bpf/bpf_test --verbose
build-modern-bpf-arm64:
name: build-modern-bpf-arm64 🙃 (system_deps)
runs-on: ubuntu-22.04
steps:
- name: Checkout Libs ⤵️
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: uraimo/[email protected]
name: Run aarch64 build 🏎️
with:
arch: aarch64
distro: archarm_latest
githubToken: ${{ github.token }}
install: |
pacman -Syu --noconfirm git cmake make llvm clang pkgconf libelf zlib libffi libbpf linux-tools glibc gcc gtest protobuf openssl tbb libb64 wget jq yaml-cpp curl c-ares grpc libyaml libpcap
# Please note: we cannot inject the BPF probe inside QEMU, so right now, we only build it
run: |
git config --global --add safe.directory ${{ github.workspace }}
.github/install-valijson.sh
mkdir -p build
cd build && cmake -DUSE_BUNDLED_DEPS=OFF -DUSE_MODERN_BPF=ON -DBUILD_MODERN_BPF_TEST=ON -DMODERN_BPF_DEBUG_MODE=ON -DBUILD_LIBSCAP_GVISOR=OFF ../
make scap-open
make bpf_test
build-modern-bpf-s390x:
name: build-modern-bpf-s390x 😁 (system_deps)
runs-on: ubuntu-22.04
steps:
- name: Checkout Libs ⤵️
uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: uraimo/[email protected]
name: Run s390x build 🏗️
with:
arch: s390x
distro: fedora_latest
githubToken: ${{ github.token }}
install: |
dnf install -y bpftool c-ares-devel clang cmake curl-devel git grpc-devel grpc-plugins gtest-devel jq-devel jsoncpp-devel libb64-devel libbpf-devel libcap-devel openssl-devel protobuf-devel tbb-devel wget
# Please note: we cannot inject the BPF probe inside QEMU, so right now, we only build it
run: |
git config --global --add safe.directory ${{ github.workspace }}
.github/install-valijson.sh
mkdir -p build
cd build && cmake -DUSE_BUNDLED_DEPS=OFF -DUSE_MODERN_BPF=ON -DBUILD_MODERN_BPF_TEST=ON -DMODERN_BPF_DEBUG_MODE=ON -DBUILD_LIBSCAP_GVISOR=OFF ../
make scap-open
make bpf_test