-
Notifications
You must be signed in to change notification settings - Fork 34
74 lines (64 loc) · 2.03 KB
/
build.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
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
name: build
on: pull_request
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.after }}
cancel-in-progress: true
jobs:
build:
name: Build retsnoop binary
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- arch: amd64
file_str: x86-64
target: x86_64-unknown-linux-gnu
steps:
- name: (amd64) Install dependencies
if: matrix.arch == 'amd64'
run: |
sudo apt-get update
sudo apt-get install -y cargo llvm libelf-dev
- name: Checkout retsnoop code
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
with:
submodules: recursive
path: 'retsnoop'
- name: (amd64) Build retsnoop
if: matrix.arch == 'amd64'
working-directory: 'retsnoop'
run: |
make -j -C src V=1
strip src/retsnoop
- name: Test retsnoop binary
working-directory: 'retsnoop/src'
run: |
file ./retsnoop | \
tee /dev/stderr | \
grep -q "${{ matrix.file_str }}"
./retsnoop --usage | grep -q Usage
ldd ./retsnoop 2>&1 | \
tee /dev/stderr | \
grep -q 'libc.so'
- name: Clean up
working-directory: 'retsnoop'
run: |
make -C src clean
- name: (amd64) Build static retsnoop
if: matrix.arch == 'amd64'
working-directory: 'retsnoop'
run: |
# LDFLAGS here would also apply to bpftool which fails to build with static
CFLAGS=--static \
make -j -C src V=1
strip src/retsnoop
- name: Test retsnoop binary
working-directory: 'retsnoop/src'
run: |
file ./retsnoop | \
tee /dev/stderr | \
grep -q "${{ matrix.file_str }}"
./retsnoop --usage | grep -q Usage
ldd ./retsnoop 2>&1 | \
tee /dev/stderr | \
grep -q 'not a dynamic executable'