-
Notifications
You must be signed in to change notification settings - Fork 202
139 lines (127 loc) · 4.36 KB
/
Copy pathreusable_e2e_tests.yaml
File metadata and controls
139 lines (127 loc) · 4.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Run libs e2e tests python framework
on:
workflow_call:
inputs:
container_plugin_artifact_name:
description: 'use a previously built custom container plugin; artifact name to be downloaded, or empty'
type: string
required: false
default: ''
test-docker:
description: "Whether to run tests with docker socket"
type: boolean
required: false
default: true
test-podman:
description: "Whether to run tests with podman socket"
type: boolean
required: false
default: true
libsversion:
description: 'libs version to be tested, eg: master'
type: string
required: false
default: 'master'
libsrepo:
description: 'libs repo to be tested, eg: falcosecurity/libs'
type: string
required: false
default: 'falcosecurity/libs'
jobs:
test-e2e:
if: inputs.test-docker || inputs.test-podman
strategy:
fail-fast: false
matrix:
name: [ system_deps, bundled_deps, asan ]
include:
- name: system_deps
cmake_opts: -DUSE_BUNDLED_DEPS=False
- name: bundled_deps
cmake_opts: -DUSE_BUNDLED_DEPS=True
- name: asan
cmake_opts: -DUSE_ASAN=True -DUSE_BUNDLED_DEPS=True
runs-on: ubuntu-24.04
steps:
- name: Install deps ⛓️
run: |
sudo apt-get update && sudo apt-get install -y --no-install-recommends \
ca-certificates \
build-essential \
git \
clang \
llvm \
pkg-config \
autoconf \
automake \
libtool \
libelf-dev \
wget \
libbpf-dev \
libcap-dev \
libtbb-dev \
libjq-dev \
libjsoncpp-dev \
libgtest-dev \
"linux-headers-$(uname -r)"
- name: Checkout Libs ⤵️
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
repository: ${{ inputs.libsrepo }}
ref: ${{ inputs.libsversion }}
- name: Install cmake 🌊
uses: ./.github/actions/install-cmake
- name: Install bpftool 🐝
uses: ./.github/actions/install-bpftool
with:
arch: 'amd64'
- name: Install deps ⛓️
run: |
sudo .github/install-deps.sh
- name: Build tests 🏗️
run: |
cmake -B build -S . \
-DBUILD_LIBSCAP_MODERN_BPF=ON \
-DENABLE_E2E_TESTS=ON \
${{ matrix.cmake_opts }} \
-DUSE_BUNDLED_LIBBPF=ON
cmake --build build --target sinsp-example driver container_plugin --parallel $(nproc)
sudo -E cmake --build build --target e2e-install-deps
- name: Download overriding custom container plugin
if: inputs.container_plugin_artifact_name != ''
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: ${{ inputs.container_plugin_artifact_name }}
path: build/test/e2e/container_plugin-prefix/src/container_plugin/
- name: Run tests - docker 🧪
if: inputs.test-docker
working-directory: build
run: |
sudo -E ../test/e2e/scripts/run_tests.sh
- name: Archive test reports - docker
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: inputs.test-docker && failure()
with:
name: ${{ matrix.name }}_docker_report
path: |
/tmp/report/
- name: Run tests - podman 🧪
if: inputs.test-podman && always()
working-directory: build
env:
# Set DOCKER_HOST pointing to podman socket
DOCKER_HOST: unix://run/podman/podman.sock
run: |
# Cleanup docker tests generated report folder
sudo rm -rf /tmp/report
# Podman tests require podman socket
sudo systemctl start podman
sudo -E ../test/e2e/scripts/run_tests.sh
- name: Archive test reports - podman
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
if: inputs.test-podman && failure()
with:
name: ${{ matrix.name }}_podman_report
path: |
/tmp/report/