refactor(ci): integrate arm64 runners + zig build #916
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |