-
Notifications
You must be signed in to change notification settings - Fork 729
133 lines (121 loc) · 4.03 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
name: CI Build
on:
pull_request:
branches: [dev]
push:
branches: [dev]
workflow_dispatch:
jobs:
build-libs-linux:
name: build-libs-linux-${{ matrix.arch }}
runs-on: 'ubuntu-22.04'
strategy:
fail-fast: false
matrix:
arch: [x86_64, aarch64]
container:
image: debian:buster
steps:
- name: Install deps ⛓️
run: |
apt update && apt install -y --no-install-recommends curl ca-certificates build-essential git clang llvm pkg-config autoconf automake libtool libelf-dev wget rpm
- name: Install bpftool
run: |
git clone https://github.com/libbpf/bpftool.git --branch v7.3.0 --single-branch
cd bpftool
git submodule update --init
cd src && make install
- 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 Libs ⤵️
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Git safe directory
run: |
git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Install zig
uses: ./.github/actions/install-zig
with:
arch: ${{ matrix.arch }}
- name: Build
env:
UBSAN_OPTIONS: print_stacktrace=1
run: |
mkdir -p build
cd build && cmake -DBUILD_DRIVER=OFF -DBUILD_BPF=OFF -DUSE_BUNDLED_DEPS=ON -DZIG_PROCESSOR=${{ matrix.arch }} ..
make -j4 package
- name: Upload rpm package
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-linux-${{ matrix.arch }}.rpm
path: |
${{ github.workspace }}/build/release/sysdig-*.rpm
- name: Upload deb package
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-linux-${{ matrix.arch }}.deb
path: |
${{ github.workspace }}/build/release/sysdig-*.deb
- name: Upload tar.gz package
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-linux-${{ matrix.arch }}.tar.gz
path: |
${{ github.workspace }}/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@v3
- 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@v3
- 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 }}