Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

chore(ci): libsinsp e2e CI caching #1756

Merged
merged 4 commits into from
Mar 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 50 additions & 12 deletions .github/workflows/e2e_ci.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
name: e2e CI
name: libsinsp e2e CI
on:
pull_request:
push:
branches:
- master
- 'release/**'
- 'maintainers/**'
workflow_dispatch:

# Checks if any concurrent jobs under the same pull request or branch are being executed
Expand All @@ -14,25 +13,18 @@ concurrency:
cancel-in-progress: true

jobs:
test-e2e:
name: test-e2e-${{ matrix.arch }} 😇 (bundled_deps)
build-test-e2e:
name: build-test-e2e-${{ matrix.arch }} 😇 (bundled_deps)
runs-on: ${{ (matrix.arch == 'arm64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-22.04' }}
strategy:
matrix:
arch: [amd64, arm64]
driver: [ {name: kmod, option: -k}, {name: bpf, option: -b}, {name: modern-bpf, option: -m} ]
fail-fast: false
steps:
- name: Checkout Libs ⤵️
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Fix kernel mmap rnd bits
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
run: sudo sysctl vm.mmap_rnd_bits=28

- name: Install deps ⛓️
run: |
Expand All @@ -43,6 +35,7 @@ jobs:
clang-14 llvm-14 \
git \
clang \
ccache \
llvm \
pkg-config \
autoconf \
Expand Down Expand Up @@ -81,11 +74,18 @@ jobs:
run: |
sudo apt install -y --no-install-recommends linux-headers-$(uname -r) gcc-multilib g++-multilib

- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3

- name: Build e2e tests 🏗️
env:
SCCACHE_GHA_ENABLED: "true"
run: |
mkdir -p build
cd build && \
cmake \
-DCMAKE_C_COMPILER_LAUNCHER=sccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
-DBUILD_BPF=ON \
-DUSE_BUNDLED_DEPS=ON \
-DUSE_ASAN=ON \
Expand All @@ -96,7 +96,45 @@ jobs:
-DUSE_BUNDLED_LIBBPF=ON \
-DUSE_BUNDLED_GTEST=ON \
..
make -j6
make -j6 libsinsp_e2e_tests
cd ..

- name: Cache build
uses: actions/cache/save@v3
if: always()
id: cache
with:
path: build
key: build-e2e-${{ matrix.arch }}-${{ github.run_id }}

test-e2e:
name: test-e2e-${{ matrix.arch }}-${{ matrix.driver.name }} 😇 (bundled_deps)
needs: [build-test-e2e]
runs-on: ${{ (matrix.arch == 'arm64' && 'actuated-arm64-8cpu-16gb') || 'ubuntu-22.04' }}
strategy:
matrix:
arch: [amd64, arm64]
driver: [ {name: kmod, option: -k}, {name: bpf, option: -b}, {name: modern-bpf, option: -m} ]
fail-fast: false
steps:
- name: Restore build
id: cache
uses: actions/cache/restore@v3
with:
path: build
key: build-e2e-${{ matrix.arch }}-${{ github.run_id }}
restore-keys: build-e2e-

- name: Fix kernel mmap rnd bits
# Asan in llvm 14 provided in ubuntu 22.04 is incompatible with
# high-entropy ASLR in much newer kernels that GitHub runners are
# using leading to random crashes: https://reviews.llvm.org/D148280
run: sudo sysctl vm.mmap_rnd_bits=28

- name: Install multilib
if: matrix.arch == 'amd64'
run: |
sudo apt install -y --no-install-recommends gcc-multilib g++-multilib

- name: Run e2e tests with ${{ matrix.driver.name }} 🏎️
if: matrix.arch == 'amd64'
Expand Down
Loading