Skip to content

Commit f3c16cc

Browse files
ekoopspoiana
authored andcommitted
ci: add install-bpftool composite action
Signed-off-by: Leonardo Di Giovanna <[email protected]>
1 parent 35f5e23 commit f3c16cc

File tree

4 files changed

+38
-21
lines changed

4 files changed

+38
-21
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: 'install-bpftool'
2+
description: 'Install bpftool'
3+
4+
inputs:
5+
version:
6+
description: "Version of bpftool to install (format: 'vX.Y.Z')"
7+
required: false
8+
default: "v7.3.0"
9+
10+
runs:
11+
using: "composite"
12+
steps:
13+
- name: Build and install bpftool from source
14+
shell: bash
15+
run: |
16+
git clone https://github.com/libbpf/bpftool.git --branch ${{ inputs.version }} --single-branch
17+
cd bpftool
18+
git submodule update --init
19+
cd src && sudo make install

.github/workflows/ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,16 @@ jobs:
103103
steps:
104104
- name: Install deps ⛓️
105105
run: |
106-
apk add g++ gcc cmake make git bash perl linux-headers autoconf automake m4 libtool elfutils-dev libelf-static patch binutils clang llvm
107-
git clone https://github.com/libbpf/bpftool.git --branch v7.3.0 --single-branch
108-
cd bpftool
109-
git submodule update --init
110-
cd src && make install
106+
apk add g++ gcc cmake make git bash perl linux-headers autoconf automake m4 libtool elfutils-dev libelf-static patch binutils clang llvm sudo
111107
112108
- name: Checkout Libs ⤵️
113109
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
114110
with:
115111
fetch-depth: 0
116112

113+
- name: Install bpftool 🐝
114+
uses: ./.github/actions/install-bpftool
115+
117116
- name: Git safe directory
118117
run: |
119118
git config --global --add safe.directory $GITHUB_WORKSPACE

.github/workflows/drivers_ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ jobs:
6464
run: |
6565
sudo apt update
6666
sudo apt install -y --no-install-recommends ca-certificates cmake build-essential clang llvm git pkg-config autoconf automake libtool libelf-dev libcap-dev linux-headers-$(uname -r)
67-
git clone https://github.com/libbpf/bpftool.git --branch v7.3.0 --single-branch
68-
cd bpftool
69-
git submodule update --init
70-
cd src && sudo make install
67+
68+
- name: Install bpftool 🐝
69+
if: needs.paths-filter.outputs.driver == 'true' || needs.paths-filter.outputs.libscap == 'true' || needs.paths-filter.outputs.libpman == 'true'
70+
uses: ./.github/actions/install-bpftool
7171

7272
- name: Build scap-open and drivers 🏗️
7373
if: needs.paths-filter.outputs.driver == 'true' || needs.paths-filter.outputs.libscap == 'true' || needs.paths-filter.outputs.libpman == 'true'
@@ -138,10 +138,10 @@ jobs:
138138
run: |
139139
sudo apt update
140140
sudo apt install -y --no-install-recommends ca-certificates cmake build-essential git pkg-config autoconf automake libelf-dev libcap-dev clang llvm libtool linux-headers-$(uname -r)
141-
git clone https://github.com/libbpf/bpftool.git --branch v7.3.0 --single-branch
142-
cd bpftool
143-
git submodule update --init
144-
cd src && sudo make install
141+
142+
- name: Install bpftool 🐝
143+
if: needs.paths-filter.outputs.driver == 'true' || needs.paths-filter.outputs.libscap == 'true' || needs.paths-filter.outputs.libpman == 'true'
144+
uses: ./.github/actions/install-bpftool
145145

146146
- name: Install multilib compilers for ia32 tests
147147
if: (needs.paths-filter.outputs.driver == 'true' || needs.paths-filter.outputs.libscap == 'true' || needs.paths-filter.outputs.libpman == 'true') && matrix.arch == 'amd64'
@@ -244,10 +244,10 @@ jobs:
244244
run: |
245245
sudo apt update
246246
sudo apt install -y --no-install-recommends ca-certificates cmake build-essential git pkg-config autoconf automake libelf-dev libcap-dev clang llvm libtool linux-headers-$(uname -r)
247-
git clone https://github.com/libbpf/bpftool.git --branch v7.3.0 --single-branch
248-
cd bpftool
249-
git submodule update --init
250-
cd src && sudo make install
247+
248+
- name: Install bpftool 🐝
249+
if: needs.paths-filter.outputs.driver == 'true' || needs.paths-filter.outputs.libscap == 'true' || needs.paths-filter.outputs.libpman == 'true'
250+
uses: ./.github/actions/install-bpftool
251251

252252
- name: Build drivers tests 🏗️
253253
if: needs.paths-filter.outputs.driver == 'true' || needs.paths-filter.outputs.libscap == 'true' || needs.paths-filter.outputs.libpman == 'true'

.github/workflows/e2e_ci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,9 @@ jobs:
5353
protobuf-compiler \
5454
linux-headers-$(uname -r)
5555
sudo .github/install-deps.sh
56-
git clone https://github.com/libbpf/bpftool.git --branch v7.3.0 --single-branch
57-
cd bpftool
58-
git submodule update --init
59-
cd src && sudo make install
56+
57+
- name: Install bpftool 🐝
58+
uses: ./.github/actions/install-bpftool
6059

6160
- name: Install multilib compilers for ia32 tests
6261
if: matrix.arch == 'amd64'

0 commit comments

Comments
 (0)