sync: cherry-pick for release/0.23.x
#4015
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: libsinsp e2e CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - master | |
| - 'release/**' | |
| workflow_dispatch: | |
| # Checks if any concurrent jobs under the same pull request or branch are being executed | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-test-e2e: | |
| name: build-test-e2e-${{ matrix.arch }} 😇 (bundled_deps) | |
| runs-on: ${{ (matrix.arch == 'arm64' && 'ubuntu-24.04-arm') || 'ubuntu-24.04' }} | |
| strategy: | |
| matrix: | |
| arch: [amd64, arm64] | |
| fail-fast: false | |
| steps: | |
| - name: Checkout Libs ⤵️ | |
| uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install deps ⛓️ | |
| run: | | |
| sudo apt-get update && sudo apt-get install -y --no-install-recommends \ | |
| ca-certificates \ | |
| build-essential \ | |
| clang \ | |
| llvm \ | |
| git \ | |
| ccache \ | |
| llvm \ | |
| pkg-config \ | |
| autoconf \ | |
| automake \ | |
| libtool \ | |
| libelf-dev \ | |
| wget \ | |
| libbpf-dev \ | |
| libcap-dev \ | |
| libtbb-dev \ | |
| libjq-dev \ | |
| libjsoncpp-dev \ | |
| libgtest-dev \ | |
| libprotobuf-dev \ | |
| protobuf-compiler \ | |
| linux-headers-$(uname -r) | |
| sudo .github/install-deps.sh | |
| - name: Install cmake 🌊 | |
| uses: ./.github/actions/install-cmake | |
| - name: Install bpftool 🐝 | |
| uses: ./.github/actions/install-bpftool | |
| with: | |
| arch: ${{ matrix.arch }} | |
| - name: Install multilib compilers for ia32 tests | |
| if: matrix.arch == 'amd64' | |
| run: | | |
| sudo apt install -y --no-install-recommends gcc-multilib g++-multilib | |
| - name: Run sccache-cache | |
| uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9 | |
| - name: Build e2e tests 🏗️ | |
| env: | |
| SCCACHE_GHA_ENABLED: "true" | |
| run: | | |
| cmake -B build -S . \ | |
| -DCMAKE_C_COMPILER_LAUNCHER=sccache \ | |
| -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \ | |
| -DBUILD_BPF=ON \ | |
| -DUSE_BUNDLED_DEPS=ON \ | |
| -DUSE_ASAN=ON \ | |
| -DUSE_UBSAN=ON \ | |
| -DENABLE_LIBSINSP_E2E_TESTS=ON \ | |
| -DBUILD_LIBSCAP_MODERN_BPF=ON \ | |
| -DBUILD_LIBSCAP_GVISOR=OFF \ | |
| -DUSE_BUNDLED_LIBBPF=ON \ | |
| -DUSE_BUNDLED_GTEST=ON | |
| cmake --build build --target libsinsp_e2e_tests --parallel $(nproc) | |
| sudo rm -vfr build/test/libsinsp_e2e/resources/_proc | |
| - name: Cache build | |
| uses: actions/cache/save@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 | |
| 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' && 'ubuntu-24.04-arm') || 'ubuntu-24.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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| with: | |
| fetch-depth: 0 | |
| - name: Restore build | |
| id: cache | |
| uses: actions/cache/restore@9255dc7a253b0ccc959486e2bca901246202afeb # v5.0.1 | |
| 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 24.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: Update apt index | |
| run: | | |
| sudo apt update | |
| - name: Install multilib compilers for ia32 tests | |
| if: matrix.arch == 'amd64' | |
| run: | | |
| sudo apt install -y --no-install-recommends gcc-multilib g++-multilib | |
| - name: Install deps | |
| run: | | |
| sudo apt install -y --no-install-recommends clang gcc llvm build-essential python3 quota linux-headers-$(uname -r) | |
| - name: Install cmake 🌊 | |
| uses: ./.github/actions/install-cmake | |
| # We have no guarantees that the kernel version is the same for the | |
| # different workers, so we rebuild the drivers. | |
| - name: Rebuild drivers | |
| run: | | |
| cmake --build build --target driver bpf --parallel $(nproc) -- -B # -B only works if make is the generator. | |
| pushd build/test/libsinsp_e2e/resources/ | |
| sudo tar xzf fake-proc.tar.gz | |
| - name: Run e2e tests with ${{ matrix.driver.name }} 🏎️ | |
| if: matrix.arch == 'amd64' | |
| env: | |
| UBSAN_OPTIONS: print_stacktrace=1 | |
| run: | | |
| cd build/test/libsinsp_e2e/ | |
| sudo -E ./libsinsp_e2e_tests ${{ matrix.driver.option }} | |
| # the arm64 workers don't have the CONFIG_QFMT_V2 flag | |
| # which is needed for the quotactl_ok test (cmd=QQUOTA_ON + id=QFMT_VFS_V0). | |
| - name: Run e2e tests with ${{ matrix.driver.name }} 🏎️ | |
| if: matrix.arch == 'arm64' | |
| env: | |
| UBSAN_OPTIONS: print_stacktrace=1 | |
| run: | | |
| cd build/test/libsinsp_e2e/ | |
| sudo -E ./libsinsp_e2e_tests ${{ matrix.driver.option }} --gtest_filter=-sys_call_test.quotactl_ok |