-
Notifications
You must be signed in to change notification settings - Fork 4
92 lines (75 loc) · 2.3 KB
/
test.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Test
on:
push:
branches:
- master
pull_request:
branches:
- "*"
workflow_dispatch: {}
permissions:
contents: read
jobs:
race-test:
# required for nftables to work correctly
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: WillAbides/[email protected]
with:
go-version-file: go.mod
- name: Cache Go files
uses: capnspacehook/cache-go@v1
# the test is compiled and run as root so that whalewall can
# interface with nftables, which is a privileged operation
- run: |
go test -c -race -o whalewall.test
sudo ./whalewall.test -test.timeout 5m -test.v
binary-test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: WillAbides/[email protected]
with:
go-version-file: go.mod
- name: Cache Go files
uses: capnspacehook/cache-go@v1
# run the integration tests but use a binary to create rules
# to test with landlock and seccomp filters active
- run: |
cd cmd/whalewall
CGO_ENABLED=0 go build -o ../../whalewall
cd ../../
go test -c -o whalewall.test
sudo ./whalewall.test -binary-tests -test.run Integration -test.timeout 5m -test.v
image-test:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Docker buildx
uses: docker/setup-buildx-action@v3
- name: Ensure Docker image builds
uses: docker/build-push-action@v5
with:
load: true
push: false
tags: whalewall:test
- name: Install Go
uses: WillAbides/[email protected]
with:
go-version-file: go.mod
- name: Cache Go files
uses: capnspacehook/cache-go@v1
# run the integration tests but use a container to create rules
# to test with landlock and seccomp filters active
- run: |
go test -c -o whalewall.test
sudo ./whalewall.test -container-tests -test.run Integration -test.timeout 5m -test.v