|
8 | 8 |
|
9 | 9 |
|
10 | 10 | jobs:
|
11 |
| - builder: |
12 |
| - env: |
13 |
| - REGISTRY: ghcr.io |
14 |
| - BUILDER_IMAGE_BASE: ghcr.io/draios/sysdig-builder-pr |
15 |
| - SKEL_BUILDER_IMAGE_BASE: ghcr.io/draios/sysdig-skel-builder-pr |
16 |
| - BUILDER_DEV: ghcr.io/draios/sysdig-builder:dev |
17 |
| - SKEL_BUILDER_DEV: ghcr.io/draios/sysdig-skel-builder:dev |
18 |
| - runs-on: ubuntu-24.04${{ matrix.platform == 'arm64' && '-arm64' || '' }} |
19 |
| - strategy: |
20 |
| - matrix: |
21 |
| - platform: |
22 |
| - - amd64 |
23 |
| - - arm64 |
24 |
| - steps: |
25 |
| - - name: Checkout Sysdig |
26 |
| - uses: actions/checkout@v4 |
27 |
| - with: |
28 |
| - fetch-depth: 0 |
29 |
| - |
30 |
| - - name: Check if builder is modified |
31 |
| - id: builder-files |
32 |
| - uses: tj-actions/changed-files@v34 |
33 |
| - with: |
34 |
| - files: | |
35 |
| - docker/builder/** |
36 |
| -
|
37 |
| - - name: Set up Docker Buildx |
38 |
| - if: steps.builder-files.outputs.any_changed == 'true' |
39 |
| - uses: docker/setup-buildx-action@v3 |
40 |
| - |
41 |
| - - name: Login to Github Packages |
42 |
| - if: steps.builder-files.outputs.any_changed == 'true' |
43 |
| - uses: docker/login-action@v3 |
44 |
| - with: |
45 |
| - registry: ${{ env.REGISTRY }} |
46 |
| - username: ${{ github.actor }} |
47 |
| - password: ${{ secrets.GITHUB_TOKEN }} |
48 |
| - |
49 |
| - - name: Get new builder image tag |
50 |
| - id: get-new-builder |
51 |
| - if: steps.builder-files.outputs.any_changed == 'true' |
52 |
| - run: | |
53 |
| - echo "builder_image=${{ (github.event.pull_request.number != '') && format('{0}:{1}', env.BUILDER_IMAGE_BASE, github.event.pull_request.number) || env.BUILDER_DEV }}" >> $GITHUB_OUTPUT |
54 |
| -
|
55 |
| - - name: Build new builder |
56 |
| - id: build-builder |
57 |
| - if: steps.builder-files.outputs.any_changed == 'true' |
58 |
| - uses: docker/build-push-action@v6 |
59 |
| - with: |
60 |
| - context: docker/builder |
61 |
| - platforms: linux/${{ matrix.platform }} |
62 |
| - tags: ${{ steps.get-new-builder.outputs.builder_image }} |
63 |
| - push: true |
64 |
| - outputs: |
65 |
| - builder_image: ${{ (steps.builder-files.outputs.any_changed == 'true') && steps.get-new-builder.outputs.builder_image || env.BUILDER_DEV }} |
66 |
| - |
67 | 11 | build-sysdig-linux:
|
68 |
| - needs: [builder] |
69 |
| - runs-on: ubuntu-24.04${{ matrix.platform == 'arm64' && '-arm64' || '' }} |
| 12 | + runs-on: ubuntu-24.04${{ matrix.platform == 'arm64' && '-arm' || '' }} |
70 | 13 | container:
|
71 |
| - image: ${{ needs.builder.outputs.builder_image }} |
| 14 | + image: ubuntu:22.04 |
72 | 15 | strategy:
|
73 | 16 | matrix:
|
74 | 17 | platform:
|
75 | 18 | - amd64
|
76 | 19 | - arm64
|
| 20 | + env: |
| 21 | + ZIG_VERSION: 0.14.0-dev.2851+b074fb7dd |
77 | 22 |
|
78 | 23 | steps:
|
79 | 24 | - name: Checkout Sysdig
|
80 | 25 | uses: actions/checkout@v4
|
81 | 26 | with:
|
82 | 27 | fetch-depth: 0
|
83 | 28 |
|
| 29 | + - name: Install deps |
| 30 | + run: | |
| 31 | + cp -v docker/builder/zig-cc /usr/bin/ |
| 32 | + cp -v docker/builder/zig-c++ /usr/bin/ |
| 33 | + apt update && \ |
| 34 | + apt install -y --no-install-recommends \ |
| 35 | + autoconf \ |
| 36 | + automake \ |
| 37 | + build-essential \ |
| 38 | + ca-certificates \ |
| 39 | + clang \ |
| 40 | + cmake \ |
| 41 | + curl \ |
| 42 | + git \ |
| 43 | + libelf-dev \ |
| 44 | + libtool \ |
| 45 | + llvm \ |
| 46 | + ninja-build \ |
| 47 | + pkg-config \ |
| 48 | + rpm \ |
| 49 | + wget \ |
| 50 | + xz-utils && \ |
| 51 | + git clone https://github.com/libbpf/bpftool.git --branch v7.3.0 --single-branch && \ |
| 52 | + cd bpftool && \ |
| 53 | + git submodule update --init && \ |
| 54 | + cd src && \ |
| 55 | + make install && \ |
| 56 | + cd ../.. && \ |
| 57 | + rm -fr bpftool && \ |
| 58 | + curl -LO https://ziglang.org/builds/zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz && \ |
| 59 | + tar -xaf zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz && \ |
| 60 | + rm -v zig-linux-$(uname -m)-${ZIG_VERSION}.tar.xz && \ |
| 61 | + cd zig-linux-$(uname -m)-${ZIG_VERSION} && \ |
| 62 | + cp -v zig /usr/bin && \ |
| 63 | + find lib -exec cp --parents {} /usr/ \; && \ |
| 64 | + cd .. && \ |
| 65 | + rm -fr zig* |
| 66 | +
|
84 | 67 | - name: Build Sysdig
|
| 68 | + env: |
| 69 | + CC: zig-cc |
| 70 | + CXX: zig-c++ |
| 71 | + AR: zig ar |
| 72 | + RANLIB: zig ranlib |
85 | 73 | run: |
|
86 |
| - cmake -DUSE_BUNDLED_DEPS=ON -DBUILD_BPF=OFF -DBUILD_DRIVER=OFF -DCMAKE_BUILD_TYPE=Release -S . -B build -G Ninja |
| 74 | + cmake \ |
| 75 | + -DUSE_BUNDLED_DEPS=ON \ |
| 76 | + -DBUILD_BPF=OFF \ |
| 77 | + -DBUILD_DRIVER=OFF \ |
| 78 | + -DCMAKE_BUILD_TYPE=Release \ |
| 79 | + -S . \ |
| 80 | + -B build \ |
| 81 | + -G Ninja |
87 | 82 | cmake --build build --target package --config Release
|
88 | 83 |
|
89 | 84 | - name: Set artifact name
|
@@ -119,8 +114,6 @@ jobs:
|
119 | 114 | os: [windows-latest, macos-13]
|
120 | 115 | include:
|
121 | 116 | - os: windows-latest
|
122 |
| - artifact_name: win |
123 |
| - artifact_ext: exe |
124 | 117 | - os: macos-13
|
125 | 118 | artifact_name: osx
|
126 | 119 | artifact_ext: dmg
|
|
0 commit comments