Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Scolaro <[email protected]>
  • Loading branch information
therealbobo committed Jan 21, 2025
1 parent ab6bfa9 commit 708130f
Showing 1 changed file with 49 additions and 61 deletions.
110 changes: 49 additions & 61 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,10 @@ on:


jobs:
builder:
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
runs-on: ubuntu-24.04${{ matrix.platform == 'arm64' && '-arm64' || '' }}
strategy:
matrix:
platform:
- amd64
- arm64
steps:
- name: Checkout Sysdig
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Check if builder is modified
id: builder-files
uses: tj-actions/changed-files@v34
with:
files: |
docker/builder/**
- name: Set up Docker Buildx
if: steps.builder-files.outputs.any_changed == 'true'
uses: docker/setup-buildx-action@v3

- name: Login to Github Packages
if: steps.builder-files.outputs.any_changed == 'true'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get new builder image tag
id: get-new-builder
if: steps.builder-files.outputs.any_changed == 'true'
run: |
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
- name: Build new builder
id: build-builder
if: steps.builder-files.outputs.any_changed == 'true'
uses: docker/build-push-action@v6
with:
context: docker/builder
platforms: linux/${{ matrix.platform }}
tags: ${{ steps.get-new-builder.outputs.builder_image }}
push: true
outputs:
builder_image: ${{ (steps.builder-files.outputs.any_changed == 'true') && steps.get-new-builder.outputs.builder_image || env.BUILDER_DEV }}

build-sysdig-linux:
needs: [builder]
runs-on: ubuntu-24.04${{ matrix.platform == 'arm64' && '-arm64' || '' }}
container:
image: ${{ needs.builder.outputs.builder_image }}
image: ubuntu:22.04
strategy:
matrix:
platform:
Expand All @@ -81,9 +24,56 @@ jobs:
with:
fetch-depth: 0

- name: Install deps
run: |

Check warning on line 28 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2046:warning:28:47: Quote this to prevent word splitting [shellcheck] Raw Output: w:.github/workflows/ci.yaml:28:9: shellcheck reported issue in this script: SC2046:warning:28:47: Quote this to prevent word splitting [shellcheck]

Check warning on line 28 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2046:warning:29:20: Quote this to prevent word splitting [shellcheck] Raw Output: w:.github/workflows/ci.yaml:28:9: shellcheck reported issue in this script: SC2046:warning:29:20: Quote this to prevent word splitting [shellcheck]

Check warning on line 28 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2046:warning:30:17: Quote this to prevent word splitting [shellcheck] Raw Output: w:.github/workflows/ci.yaml:28:9: shellcheck reported issue in this script: SC2046:warning:30:17: Quote this to prevent word splitting [shellcheck]

Check warning on line 28 in .github/workflows/ci.yaml

View workflow job for this annotation

GitHub Actions / actionlint

[actionlint] reported by reviewdog 🐶 shellcheck reported issue in this script: SC2046:warning:31:14: Quote this to prevent word splitting [shellcheck] Raw Output: w:.github/workflows/ci.yaml:28:9: shellcheck reported issue in this script: SC2046:warning:31:14: Quote this to prevent word splitting [shellcheck]
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 -S . -B build -G Ninja
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
Expand Down Expand Up @@ -119,8 +109,6 @@ jobs:
os: [windows-latest, macos-13]
include:
- os: windows-latest
artifact_name: win
artifact_ext: exe
- os: macos-13
artifact_name: osx
artifact_ext: dmg
Expand Down

0 comments on commit 708130f

Please sign in to comment.