-
Notifications
You must be signed in to change notification settings - Fork 187
/
action.yml
37 lines (35 loc) · 1.3 KB
/
action.yml
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
name: "Install debian packages"
description: "Install debian packages needed by inspektor-gadget"
inputs:
libbpf-version:
description: "Version of the libbpf to install."
default: "1:0.4.0-1ubuntu1"
libseccomp-version:
description: "Version of the libseccomp to install."
default: "2.5.1-1ubuntu1~20.04.2"
runs:
using: "composite"
steps:
- name: Cache debian packages
uses: actions/cache@v2
id: cache-debs
with:
path: "~/cache-debs"
# Update cache key if you add or update a package.
key: v3
- name: Install debian packages
shell: bash
run: |
if [[ "${{steps.cache-debs.outputs.cache-hit}}" == 'true' ]]; then
sudo cp --verbose --force --recursive ~/cache-debs/* /
else
sudo apt install -y software-properties-common llvm
sudo add-apt-repository -y ppa:tuxinvader/kernel-build-tools
sudo apt-get update
sudo apt install -y libbpf-dev="${{inputs.libbpf-version}}" libseccomp-dev="${{inputs.libseccomp-version}}"
mkdir -p ~/cache-debs
sudo dpkg -L libbpf-dev libseccomp-dev llvm | \
while IFS= read -r f; do \
if test -f $f; then echo $f; fi; \
done | xargs cp --parents --target-directory ~/cache-debs/
fi