-
Notifications
You must be signed in to change notification settings - Fork 730
140 lines (130 loc) · 3.87 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
133
134
135
136
137
138
139
140
name: CI Build
on:
pull_request:
branches: [dev]
push:
branches: [dev]
workflow_dispatch:
jobs:
build-sysdig-linux:
runs-on: ubuntu-24.04${{ matrix.platform == 'arm64' && '-arm' || '' }}
container:
image: ubuntu:22.04
strategy:
matrix:
platform:
- amd64
- arm64
env:
ZIG_VERSION: 0.14.0-dev.2851+b074fb7dd
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install deps
run: |
cp -v scripts/zig-cc /usr/bin/
cp -v scripts/zig-c++ /usr/bin/
apt update && \
apt install -y --no-install-recommends \
autoconf \
automake \
build-essential \
ca-certificates \
clang \
cmake \
curl \
git \
libelf-dev \
libtool \
llvm \
ninja-build \
pkg-config \
rpm \
wget \
xz-utils && \
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 ../.. && \
rm -fr bpftool && \
curl -LO https://ziglang.org/builds/zig-linux-"$(uname -m)"-"${ZIG_VERSION}".tar.xz && \
tar -xaf zig-linux-"$(uname -m)"-"${ZIG_VERSION}".tar.xz && \
rm -v zig-linux-"$(uname -m)"-"${ZIG_VERSION}".tar.xz && \
cd zig-linux-"$(uname -m)"-"${ZIG_VERSION}" && \
cp -v zig /usr/bin && \
find lib -exec cp --parents {} /usr/ \; && \
cd .. && \
rm -fr zig*
- name: Build Sysdig
env:
CC: zig-cc
CXX: zig-c++
AR: zig ar
RANLIB: zig ranlib
run: |
cmake \
-DUSE_BUNDLED_DEPS=ON \
-DBUILD_BPF=OFF \
-DBUILD_DRIVER=OFF \
-DCMAKE_BUILD_TYPE=Release \
-S . \
-B build \
-G Ninja
cmake --build build --target package --config Release
- name: Set artifact name
id: artifact_name
run: |
echo "name=sysdig-dev-linux-$(echo ${{ matrix.platform }} | sed -e 's|/|-|g')" >> "$GITHUB_OUTPUT"
- name: Upload rpm package
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact_name.outputs.name }}.rpm
path: |
build/sysdig-*.rpm
- name: Upload deb package
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact_name.outputs.name }}.deb
path: |
build/sysdig-*.deb
- name: Upload tar.gz package
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact_name.outputs.name }}.tar.gz
path: |
build/sysdig-*.tar.gz
build-sysdig-others:
name: build-sysdig-${{ matrix.os }}-${{ matrix.arch }}
strategy:
matrix:
os: [windows-latest, macos-13, macos-14]
include:
- os: windows-latest
artifact_name: win
artifact_ext: exe
arch: x86_64
- os: macos-13
artifact_name: osx
artifact_ext: dmg
arch: x86_64
- os: macos-14
artifact_name: osx
artifact_ext: dmg
arch: arm64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
- name: Build
run: |
cmake -Wno-dev -S . -B build
cmake --build build --target package --config Release
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: sysdig-dev-${{ matrix.artifact_name }}-${{ matrix.arch }}
path: build/sysdig-*.${{ matrix.artifact_ext }}