Skip to content

wip

wip #883

Workflow file for this run

name: CI Build
on:
pull_request:
branches: [dev]
push:
branches: [dev]
workflow_dispatch:
jobs:
build-sysdig-linux-amd64:
runs-on: ubuntu-latest
container:
image: debian:buster
steps:
- name: Install deps ⛓️
run: |
apt update && apt install -y --no-install-recommends ninja-build curl ca-certificates build-essential git clang llvm pkg-config autoconf automake libtool libelf-dev wget libc-ares-dev libcurl4-openssl-dev libssl-dev libtbb-dev libjq-dev libjsoncpp-dev libgrpc++-dev protobuf-compiler-grpc libgtest-dev libprotobuf-dev linux-headers-amd64
DIR=$(pwd)
cd /tmp
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 ${DIR}
- 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 Sysdig
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install zig
uses: ./.github/actions/install-zig
- name: Build Sysdig
run: |
cmake -DUSE_BUNDLED_DEPS=ON -DBUILD_BPF=ON -DBUILD_SYSDIG_MODERN_BPF=ON -DBUILD_DRIVER=ON -DCMAKE_BUILD_TYPE=Release -S . -B build -G Ninja
cd build
ninja package
- name: Upload rpm package
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-linux-x86_64.rpm
path: |
build/release/sysdig-*.rpm
- name: Upload deb package
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-linux-x86_64.deb
path: |
build/release/sysdig-*.deb
- name: Upload tar.gz package
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-linux-x86_64.tar.gz
path: |
build/release/sysdig-*.tar.gz
build-sysdig-linux-arm64:
env:
REGISTRY: ghcr.io
BUILDER_IMAGE_BASE: ghcr.io/draios/sysdig-builder-pr
SKEL_BUILDER_IMAGE_BASE: ghcr.io/draios/sysdig-skel-builder-pr
BUILDER_DEV: ghcr.io/draios/sysdig-builder:dev
SKEL_BUILDER_DEV: ghcr.io/draios/sysdig-skel-builder:dev
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: true
runs-on: ubuntu-latest
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
with:
path: sysdig
- name: Create build dir
run: |
mkdir -p ${{ github.workspace }}/sysdig-build-aarch64
- name: Login to Github Packages
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: 'amd64,arm64'
- name: Run the build skeleton process with Docker
uses: addnab/docker-run-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
image: ${{ needs.builder.outputs.skeleton_builder_image }}
options: --platform=linux/arm64 -v ${{ github.workspace }}/sysdig:/source/sysdig -v ${{ github.workspace }}/sysdig-build-aarch64:/build/dev-packages -v ${{ github.workspace }}/skeleton-build:/build-skeleton
run: |
mkdir -p /build/dev-packages && \
build cmake-skeleton && \
build make-skeleton
- name: Run the build process with Docker
uses: addnab/docker-run-action@v3
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: ${{ env.REGISTRY }}
image: ${{ needs.builder.outputs.builder_image }}
options: --platform=linux/arm64 -v ${{ github.workspace }}/sysdig:/source/sysdig -v ${{ github.workspace }}/sysdig-build-aarch64:/build/dev-packages -v ${{ github.workspace }}/skeleton-build:/build-skeleton
run: |
mkdir -p /build/dev-packages && \
build cmake && \
build package && \
cp /build/release/sysdig-* /build/dev-packages
- name: Upload deb package
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-linux-aarch64.deb
path: |
${{ github.workspace }}/sysdig-build-aarch64/sysdig-*.deb
- name: Upload rpm package
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-linux-aarch64.rpm
path: |
${{ github.workspace }}/sysdig-build-aarch64/sysdig-*.rpm
- name: Upload tar.gz package
uses: actions/upload-artifact@v3
with:
name: sysdig-dev-linux-aarch64.tar.gz
path: |
${{ github.workspace }}/sysdig-build-aarch64/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@v4
- 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@v4
- 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 }}