Skip to content

Commit 7fdebbc

Browse files
committed
ci: add check for ebpf lib out of sync
Signed-off-by: Mattia Meleleo <[email protected]>
1 parent 42f0a25 commit 7fdebbc

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

.github/workflows/pull_request.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,11 @@ jobs:
2727
go-version-file: "go.mod"
2828
cache: "false"
2929
- name: Run verification and unit tests
30-
run: make docker-generate verify cov-exclude-generated check-go-mod
30+
run: make docker-generate verify cov-exclude-generated check-go-mod notices-update check-ebpf-ver-synced check-clean-work-tree
3131
- name: Report coverage
3232
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
3333
env:
3434
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3535
with:
3636
files: ./testoutput/cover.txt
3737
flags: unittests
38-
verify-notices:
39-
runs-on: ubuntu-24.04
40-
steps:
41-
- name: Checkout Repo
42-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
43-
with:
44-
persist-credentials: false
45-
- name: Setup Go
46-
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
47-
with:
48-
go-version-file: "go.mod"
49-
cache: "false"
50-
- run: make notices-update check-clean-work-tree

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ CFLAGS := -O2 -g -Wunaligned-access -Wpacked -Wpadded -Wall -Werror $(CFLAGS)
3939

4040
CLANG_TIDY ?= clang-tidy
4141

42-
CILIUM_EBPF_VER ?= $(call gomod-version,cilium/ebpf)
42+
CILIUM_EBPF_VER ?= v0.20.0
43+
CILIUM_EBPF_PKG := github.com/cilium/ebpf
4344

4445
# regular expressions for excluded file patterns
4546
EXCLUDE_COVERAGE_FILES="(_bpfel.go)|(/opentelemetry-ebpf-instrumentation/internal/test/)|(/opentelemetry-ebpf-instrumentation/configs/)|(.pb.go)|(/pkg/export/otel/metric/)|(/cmd/obi-genfiles)"
@@ -472,3 +473,13 @@ COMMIT ?= "HEAD"
472473
add-tags: verify-mods
473474
@[ "${MODSET}" ] || ( echo ">> env var MODSET is not set"; exit 1 )
474475
$(MULTIMOD) tag -m ${MODSET} -c ${COMMIT}
476+
477+
.PHONY: check-ebpf-ver-synced
478+
check-ebpf-ver-synced:
479+
@if grep -Fq "$(CILIUM_EBPF_PKG) $(CILIUM_EBPF_VER)" go.mod && \
480+
grep -Fq "$(CILIUM_EBPF_PKG) $(CILIUM_EBPF_VER)" bpf/bpfcore/placeholder.go; then \
481+
echo "ebpf lib version in sync"; \
482+
else \
483+
echo "ebpf lib version out of sync between go.mod and bpf/bpfcore/placeholder.go!"; \
484+
exit 1; \
485+
fi

0 commit comments

Comments
 (0)