-
Notifications
You must be signed in to change notification settings - Fork 729
131 lines (118 loc) · 3.97 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
name: CI Build
on:
pull_request:
branches: [dev]
push:
branches: [dev]
workflow_dispatch:
jobs:
build-sysdig-linux:
runs-on: ubuntu-latest
strategy:
matrix:
platform:
- linux/amd64
- linux/arm64
container:
image: debian:buster
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Install deps ⛓️
run: |
apt update && apt install -y --no-install-recommends ninja-build curl ca-certificates build-essential git clang llvm pkg-config autoconf automake libtool libelf-dev wget libc-ares-dev libcurl4-openssl-dev libssl-dev libtbb-dev libjq-dev libjsoncpp-dev libgrpc++-dev protobuf-compiler-grpc libgtest-dev libprotobuf-dev
DIR=$(pwd)
cd /tmp
git clone https://github.com/libbpf/bpftool.git --branch v7.3.0 --single-branch
cd bpftool
git submodule update --init
cd src
make install
cd ${DIR}
- name: Install a recent version of CMake ⛓️
run: |
curl -L -o /tmp/cmake.tar.gz https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5-linux-$(uname -m).tar.gz
gzip -d /tmp/cmake.tar.gz
tar -xpf /tmp/cmake.tar --directory=/tmp
cp -R /tmp/cmake-3.22.5-linux-$(uname -m)/* /usr
rm -rf /tmp/cmake-3.22.5-linux-$(uname -m)/
- name: Checkout Sysdig
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install zig
uses: ./.github/actions/install-zig
- name: Build Sysdig
run: |
cmake -DUSE_BUNDLED_DEPS=ON -DBUILD_BPF=OFF -DBUILD_SYSDIG_MODERN_BPF=OFF -DBUILD_DRIVER=OFF -DCMAKE_BUILD_TYPE=Release -S . -B build
cd build
make -j $(nproc) package
- name: Upload rpm package
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-$(${{ matrix.arch }} | sed -e 's|/||g').rpm
path: |
build/release/sysdig-*.rpm
- name: Upload deb package
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-linux-$(${{ matrix.arch }} | sed -e 's|/||g').deb
path: |
build/release/sysdig-*.deb
- name: Upload tar.gz package
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-linux-$(${{ matrix.arch }} | sed -e 's|/||g').tar.gz
path: |
build/release/sysdig-*.tar.gz
build-sysdig-others-amd64:
name: build-sysdig-other-amd64
strategy:
matrix:
os: [windows-latest, macos-13]
include:
- os: windows-latest
artifact_name: win
artifact_ext: exe
- os: macos-13
artifact_name: osx
artifact_ext: dmg
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
- name: Build
run: |
mkdir -p build
cd build && cmake -Wno-dev ..
cmake --build . --target package --config Release
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-${{ matrix.artifact_name }}-x86_64.${{ matrix.artifact_ext }}
path: |
build/sysdig-*.${{ matrix.artifact_ext }}
build-sysdig-others-arm64:
name: build-sysdig-other-arm64
strategy:
matrix:
os: [macos-14]
include:
- os: macos-14
artifact_name: osx
artifact_ext: dmg
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
- name: Build
run: |
mkdir -p build
cd build && cmake -Wno-dev ..
cmake --build . --target package --config Release
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-${{ matrix.artifact_name }}-arm64.${{ matrix.artifact_ext }}
path: |
build/sysdig-*.${{ matrix.artifact_ext }}