-
Notifications
You must be signed in to change notification settings - Fork 752
152 lines (141 loc) · 4.32 KB
/
ci.yaml
File metadata and controls
152 lines (141 loc) · 4.32 KB
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
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' && '-arm64' || '' }}
container:
image: ubuntu:22.04
strategy:
matrix:
platform:
- amd64
- arm64
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install deps
run: |
export ZIG_VERSION=0.14.0-dev.2851+b074fb7dd
cp -v docker/builder/zig-cc /usr/bin/
cp -v docker/builder/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 \
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
run: |
cmake \
-DUSE_BUNDLED_DEPS=ON \
-DBUILD_BPF=OFF \
-DBUILD_DRIVER=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=/usr/bin/zig-cc \
-DCMAKE_CXX_COMPILER=/usr/bin/zig-c++ \
-S . \
-B build \
-G Ninja
cmake --build build --target package --config Release
- name: Set artifact name
id: artifact_name
run: |
echo "name=sysdig-dev-$(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-amd64:
name: build-sysdig-other-amd64
strategy:
matrix:
os: [windows-latest, macos-13]
include:
- os: windows-latest
- os: macos-13
artifact_name: osx
artifact_ext: dmg
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 }}-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: |
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 }}-arm64.${{ matrix.artifact_ext }}
path: |
build/sysdig-*.${{ matrix.artifact_ext }}