forked from bpfman/bpfman
-
Notifications
You must be signed in to change notification settings - Fork 0
193 lines (158 loc) · 5.62 KB
/
integration-tests.yaml
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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: basic-integration-tests
on: # yamllint disable-line rule:truthy
push:
branches: [main]
tags:
- v*
pull_request:
branches:
- main
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
basic-integration-tests:
runs-on: ubuntu-latest
needs: [build, bpfman-image-build]
env:
XDP_PASS_IMAGE_LOC: quay.io/bpfman-bytecode/xdp_pass:${GITHUB_REF_NAME}
TC_PASS_IMAGE_LOC: quay.io/bpfman-bytecode/tc_pass:${GITHUB_REF_NAME}
TRACEPOINT_IMAGE_LOC: quay.io/bpfman-bytecode/tracepoint:${GITHUB_REF_NAME}
UPROBE_IMAGE_LOC: quay.io/bpfman-bytecode/uprobe:${GITHUB_REF_NAME}
URETPROBE_IMAGE_LOC: quay.io/bpfman-bytecode/uretprobe:${GITHUB_REF_NAME}
KPROBE_IMAGE_LOC: quay.io/bpfman-bytecode/kprobe:${GITHUB_REF_NAME}
KRETPROBE_IMAGE_LOC: quay.io/bpfman-bytecode/kretprobe:${GITHUB_REF_NAME}
XDP_COUNTER_IMAGE_LOC: quay.io/bpfman-bytecode/go-xdp-counter:${GITHUB_REF_NAME}
TC_COUNTER_IMAGE_LOC: quay.io/bpfman-bytecode/go-tc-counter:${GITHUB_REF_NAME}
TRACEPOINT_COUNTER_IMAGE_LOC: quay.io/bpfman-bytecode/go-tracepoint-counter:${GITHUB_REF_NAME}
FENTRY_IMAGE_LOC: quay.io/bpfman-bytecode/fentry:${GITHUB_REF_NAME}
FEXIT_IMAGE_LOC: quay.io/bpfman-bytecode/fexit:${GITHUB_REF_NAME}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: network=host
- name: Checkout bpfman
uses: actions/checkout@v4
- name: Download bpfman x86_64 build
uses: actions/download-artifact@v4
with:
name: bpfman-debug-linux-x86_64
merge-multiple: true
- name: Unpack binaries
run: |
mkdir -p target/debug
tar -C target/debug -xzvf bpfman-debug-linux-x86_64.tar.gz
- name: Download Integration Test eBPF
uses: actions/download-artifact@v4
with:
name: bpfman-integration-test
merge-multiple: true
- name: Unpack Integration Test eBPF
run: |
tar -xzvf integration-test.tar.gz
- name: Download manpages
uses: actions/download-artifact@v4
with:
name: bpfman-manpages
merge-multiple: true
- name: Unpack manpages
run: |
tar -xzvf manpages.tar.gz
- name: Download CLI TAB Completion
uses: actions/download-artifact@v4
with:
name: bpfman-cli-tab-completion
merge-multiple: true
- name: Unpack CLI TAB Completion
run: |
tar -xzvf cli-tab-completion.tar.gz
- name: Install libelf-dev
run: |
sudo apt-get update
sudo apt-get install -y linux-headers-`uname -r` clang lldb lld libelf-dev gcc-multilib libbpf-dev
- name: Generate go wrapped eBPF
run: |
cd examples && make generate
- name: build and push bytecode images to local registry
run: |
- name: Run the bpfman installer
run: sudo ./scripts/setup.sh install
- name: Verify the bpfman systemd service is active
run: systemctl is-active bpfman.socket
- name: Verify the CLI can reach bpfman
run: sudo bpfman list
- name: Verify the manpages are installed
run: man bpfman list
- name: Stop the bpfman systemd service
run: |
sudo systemctl stop bpfman
sudo ./scripts/setup.sh uninstall
- name: Run integration tests
run: cargo xtask integration-test
coverage:
needs: [build, build-go]
runs-on: ubuntu-latest
steps:
- name: Download rust coverage artifacts
uses: actions/download-artifact@v4
with:
name: coverage-rust
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./lcov.info
verbose: true
# Creates Release
# Copies built bpfman binaries to release artifacts
# Publish's bpfman and bpfman-api crates to crates.io
release:
if: startsWith(github.ref, 'refs/tags/v')
needs: [build]
environment: crates.io
runs-on: ubuntu-latest
steps:
- name: Checkout bpfman
uses: actions/checkout@v4
- name: Set env
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
if [[ ${GITHUB_REF#refs/*/} =~ "rc" ]]; then
echo "PRE_RELEASE=true" >> $GITHUB_ENV
else
echo "PRE_RELEASE=false" >> $GITHUB_ENV
fi
- name: Download bpfman Release Binaries
uses: actions/download-artifact@v4
with:
pattern: bpfman-release-*
merge-multiple: true
- name: release
uses: softprops/action-gh-release@v2
with:
body_path: ./changelogs/CHANGELOG-${{ env.RELEASE_VERSION }}.md
prerelease: ${{ env.PRE_RELEASE }}
files: |
bpfman-linux-x86_64.tar.gz
- name: publish bpfman crate
run: cargo publish -p bpfman --token ${{ secrets.BPFMAN_DEV_TOKEN }}
- name: publish bpfman-api crate
run: cargo publish -p bpfman-api --token ${{ secrets.BPFMAN_DEV_TOKEN }}
- name: publish bpf-log-exporter crate
run: cargo publish -p bpf-log-exporter --token ${{ secrets.BPFMAN_DEV_TOKEN }}
- name: publish bpf-metrics-exporter crate
run: cargo publish -p bpf-metrics-exporter --token ${{ secrets.BPFMAN_DEV_TOKEN }}
build-workflow-complete:
needs:
[
check-license,
build,
build-go,
build-docs,
coverage,
basic-integration-tests,
]
runs-on: ubuntu-latest
steps:
- name: Build Complete
run: echo "Build Complete"