-
Notifications
You must be signed in to change notification settings - Fork 7
74 lines (62 loc) · 2.18 KB
/
Copy pathobi-patch-ci.yml
File metadata and controls
74 lines (62 loc) · 2.18 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
name: OBI Patch CI
on:
pull_request:
paths:
- "ebpf/patches/obi/**"
- "ebpf/Dockerfile"
- ".github/workflows/obi-patch-ci.yml"
push:
branches:
- main
paths:
- "ebpf/patches/obi/**"
- "ebpf/Dockerfile"
- ".github/workflows/obi-patch-ci.yml"
permissions:
contents: read
concurrency:
group: obi-patch-${{ github.ref }}
cancel-in-progress: true
jobs:
test-obi-patches:
runs-on: ubuntu-22.04
timeout-minutes: 45
steps:
- uses: actions/checkout@v7
- name: Read OBI build pins
run: |
{
echo "OBI_VERSION=$(grep -oP '^ARG OBI_VERSION=\K.*' ebpf/Dockerfile | head -1 | tr -d '\"')"
echo "OBI_REVISION=$(grep -oP '^ARG OBI_REVISION=\K.*' ebpf/Dockerfile | head -1 | tr -d '\"')"
echo "OBI_GENERATOR=$(grep -oP '^FROM \Kghcr.io/open-telemetry/obi-generator:[^ ]+' ebpf/Dockerfile | head -1)"
} >> "$GITHUB_ENV"
- name: Clone OBI and apply patches
run: |
git clone --depth 1 --branch "$OBI_VERSION" \
https://github.com/open-telemetry/opentelemetry-ebpf-instrumentation.git "$RUNNER_TEMP/obi"
test "$(git -C "$RUNNER_TEMP/obi" rev-parse HEAD)" = "$OBI_REVISION"
for p in "$GITHUB_WORKSPACE"/ebpf/patches/obi/*.patch; do
[ -e "$p" ] || break
git -C "$RUNNER_TEMP/obi" apply "$p"
done
- name: Check preemption guards
working-directory: ${{ runner.temp }}/obi
run: ./scripts/lint-preempt-guard.sh
- name: Generate eBPF sources
run: |
docker run --rm \
-v "$RUNNER_TEMP/obi:/src" \
-w /src \
"$OBI_GENERATOR"
- uses: actions/setup-go@v7
with:
go-version-file: ${{ runner.temp }}/obi/go.mod
cache: false
- name: Download Go modules
working-directory: ${{ runner.temp }}/obi
run: go mod download
- name: Test tpinjector package
working-directory: ${{ runner.temp }}/obi
run: go test -race ./pkg/internal/ebpf/tpinjector
- name: Build production OBI stage
run: docker build --target obi-builder --file ebpf/Dockerfile .