-
Notifications
You must be signed in to change notification settings - Fork 39
120 lines (91 loc) · 2.54 KB
/
Copy pathtest.yml
File metadata and controls
120 lines (91 loc) · 2.54 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
name: Run tests
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
vendor:
name: Vendor check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- run: make vendor
- run: ./hack/tree_status.sh
lint:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Install build deps for cgo
run: |
sudo apt-get update
sudo apt-get install -y libseccomp-dev libbpf-dev libbpfcc-dev
- run: make install.tools
- run: make validate
build:
name: Build binary + docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Install build deps
run: |
sudo apt-get update
sudo apt-get install -y libseccomp-dev libbpf-dev libbpfcc-dev go-md2man
- run: make binary
- run: make docs
- uses: actions/upload-artifact@v7
with:
name: oci-seccomp-bpf-hook
path: bin/*
test-unit:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Install build deps
run: |
sudo apt-get update
sudo apt-get install -y libseccomp-dev libbpf-dev libbpfcc-dev
- run: make test-unit
test-integration:
name: Integration tests (bats)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: Install runtime + BPF deps
run: |
sudo apt-get update
sudo apt-get install -y \
podman crun bats \
libseccomp-dev libbpf-dev libbpf1 libbpfcc-dev \
bpfcc-tools "linux-headers-$(uname -r)" \
go-md2man jq
- run: make binary
- run: sudo make PREFIX=/usr install
- name: Run integration tests
run: sudo make test-integration BATS_OPTS=--tap
- name: Capture journal on failure
if: failure()
run: sudo journalctl -b | sudo tee journal.txt > /dev/null || true
- uses: actions/upload-artifact@v7
if: failure()
with:
name: integration-journal
path: journal.txt