Skip to content

Commit 68f0c23

Browse files
committed
ci: verify packaging deb and rpm succeeds
1 parent 36c584c commit 68f0c23

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

.github/workflows/build-and-test.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,59 @@ jobs:
465465
$BENV_IMAGE \
466466
./build.sh --debug --asan unit_tests test
467467
468+
build-deb-rpm:
469+
name: build-deb-rpm
470+
runs-on: ubuntu-24.04
471+
steps:
472+
- name: Check out the codebase
473+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
474+
with:
475+
fetch-depth: 0
476+
477+
- name: Cache and install ccache
478+
uses: awalsh128/cache-apt-pkgs-action@latest
479+
with:
480+
packages: ccache
481+
version: 1.0
482+
483+
- name: Setup ccache
484+
uses: hendrikmuhs/[email protected]
485+
with:
486+
key: ccache-build-packages
487+
max-size: 1G
488+
verbose: 2
489+
490+
- name: Build RPM/DEB packages
491+
run: |
492+
# Prepare output and ccache directories
493+
mkdir -p "${{ github.workspace }}/out"
494+
mkdir -p "${{ github.workspace }}/.ccache"
495+
# Ensure the build container user (uid 1000) can write here
496+
sudo chown -R 1000:1000 "${{ github.workspace }}/out" || true
497+
chmod -R 777 "${{ github.workspace }}/.ccache" || true
498+
499+
docker pull $BENV_IMAGE
500+
git submodule update --init --recursive ext/
501+
502+
# Configure and build the project into /home/user/out
503+
docker run -t --rm \
504+
--mount "type=bind,source=${{ github.workspace }}/.ccache,destination=/ccache" \
505+
--mount "type=bind,source=${{ github.workspace }},destination=/home/user/src,readonly" \
506+
--mount "type=bind,source=${{ github.workspace }}/out,destination=/home/user/out" \
507+
--env EBPF_NET_SRC_ROOT=/home/user/src \
508+
--env CCACHE_DIR=/ccache \
509+
$BENV_IMAGE \
510+
./build.sh pipeline
511+
512+
# Run CPack in the configured build directory
513+
docker run -t --rm \
514+
--mount "type=bind,source=${{ github.workspace }},destination=/home/user/src,readonly" \
515+
--mount "type=bind,source=${{ github.workspace }}/out,destination=/home/user/out" \
516+
--env EBPF_NET_SRC_ROOT=/home/user/src \
517+
--workdir /home/user/out \
518+
$BENV_IMAGE \
519+
cpack -G 'RPM;DEB'
520+
468521
e2e-otel-jsonl:
469522
name: e2e-otel-jsonl
470523
needs: [build-reducer, build-kernel-collector, build-k8s-collector]

0 commit comments

Comments
 (0)