-
Notifications
You must be signed in to change notification settings - Fork 44
71 lines (59 loc) · 2.2 KB
/
build.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
name: CPP CI
on:
pull_request:
paths-ignore:
- '**.md'
- 'Dockerfile'
concurrency:
# Cancel any CI/CD workflow currently in progress for the same PR.
# Allow running concurrently with any other commits.
group: build-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
build_ubuntu:
strategy:
matrix:
configurations: [Debug, Release]
runs-on: ubuntu-latest
env:
# Configuration type to build. For documentation on how build matrices work, see
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: ${{matrix.configurations}}
steps:
- name: Install dependencies
run: |
sudo apt install libboost-dev libboost-filesystem-dev libboost-program-options-dev libyaml-cpp-dev valgrind
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build
run: |
mkdir build
cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_CONFIGURATION}}
cmake --build build -j $(nproc)
- name: Run unit tests
run: ./tests -d yes
- name: Test for memory leaks
# Any memory leaks will cause the test to fail
# This BPF program was chosen because it is the largest one in the repo
run: valgrind --leak-check=full --errors-for-leak-kinds=all --show-leak-kinds=all --error-exitcode=1 ./check ebpf-samples/cilium/bpf_xdp_snat_linux_v1.o 2/1
build_windows:
strategy:
matrix:
configurations: [Debug, Release]
runs-on: windows-2022
env:
# Configuration type to build. For documentation on how build matrices work, see
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: ${{matrix.configurations}}
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Build
run: |
mkdir build
cmake -B build
cmake --build build -j $(nproc) --config ${{env.BUILD_CONFIGURATION}}
- name: Run unit tests
run: ./${{env.BUILD_CONFIGURATION}}/tests -d yes