Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build ebpf objects on CI #1639

Merged
merged 6 commits into from
Feb 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 117 additions & 0 deletions .github/workflows/beyla_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Beyla Build

on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]

jobs:
build-ebpf:
name: Build eBPF objects and run tests
runs-on: ubuntu-latest
outputs:
should_test: ${{ steps.commit.outputs.should_test }}
permissions:
contents: write # Allow commits back to the repo
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
token: ${{ secrets.BEYLA_WORKFLOW_TOKEN }}

- name: commit-check
id: commit-check
run: |
LAST_COMMIT_MESSAGE=$(git log -1 --pretty=%B)

if echo "$LAST_COMMIT_MESSAGE" | grep -q '\[do-not-rebuild\]'
then
echo "should_build=false" >> $GITHUB_OUTPUT
else
echo "should_build=true" >> $GITHUB_OUTPUT
fi

- name: Compile eBPF Programs
if: ${{ steps.commit-check.outputs.should_build == 'true' }}
run: |
echo COMMITS $${{ github.event.head_commit.message }}
make docker-generate

# NOTE: The user email is {user.id}+{user.login}@users.noreply.github.com.
# See users API: https://api.github.com/users/github-actions%5Bbot%5D
- name: Commit Compiled eBPF Programs
id: commit
if: ${{ steps.commit-check.outputs.should_build == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.BEYLA_WORKFLOW_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -u
git commit -m "CI: Auto-build eBPF binaries[do-not-rebuild]" || exit 0
git push
echo "should_test=false" >> $GITHUB_OUTPUT

run-integration-tests:
name: Pull request integration tests
uses: ./.github/workflows/pull_request_integration_tests.yml
needs: build-ebpf
if: needs.build-ebpf.outputs.should_test != 'false'

run-integration-tests-arm:
name: Pull request integration tests ARM
uses: ./.github/workflows/pull_request_integration_tests_arm.yml
needs: build-ebpf
if: needs.build-ebpf.outputs.should_test != 'false'

run-integration-tests-vm-5-15-x86-64:
name: Pull request integration tests on VM 5.15 x86_64
uses: ./.github/workflows/pull_request_integration_tests_vm_5.15_x86_64.yml
needs: build-ebpf
if: needs.build-ebpf.outputs.should_test != 'false'

run-integration-tests-vm-6-10-x86-64:
name: Pull request integration tests on VM 6.10 x86_64
uses: ./.github/workflows/pull_request_integration_tests_vm_6.10_x86_64.yml
needs: build-ebpf
if: needs.build-ebpf.outputs.should_test != 'false'

run-integration-tests-k8s:
name: Pull request K8s integration tests
uses: ./.github/workflows/pull_request_k8s_integration_tests.yml
needs: build-ebpf
if: needs.build-ebpf.outputs.should_test != 'false'

run-oats-tests:
name: PR OATS test
uses: ./.github/workflows/pull_request_oats_test.yml
needs: build-ebpf
if: needs.build-ebpf.outputs.should_test != 'false'

run-pr-checks:
name: Pull request checks
uses: ./.github/workflows/pull_request.yml
needs: build-ebpf
if: needs.build-ebpf.outputs.should_test != 'false'

clang-format-check:
name: Clang Format Check
uses: ./.github/workflows/clang-format-check.yml
needs: build-ebpf
if: needs.build-ebpf.outputs.should_test != 'false'

clang-tidy-check:
name: Clang Tidy Check
uses: ./.github/workflows/clang-tidy-check.yml
needs: build-ebpf
if: needs.build-ebpf.outputs.should_test != 'false'

git-lfs-check:
name: Check git-lfs files
uses: ./.github/workflows/git-lfs-check.yml
needs: build-ebpf
if: needs.build-ebpf.outputs.should_test != 'false'


5 changes: 1 addition & 4 deletions .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Clang Format Check

on:
push:
branches: [ 'main', 'release-*' ]
pull_request:
branches: [ 'main', 'release-*' ]
workflow_call:

jobs:
clang-format:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/clang-tidy-check.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Clang Tidy Check

on:
push:
branches: [ 'main', 'release-*' ]
pull_request:
branches: [ 'main', 'release-*' ]
workflow_call:

jobs:
clang-tidy:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/git-lfs-check.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Check git-lfs files

on:
push:
branches: [ 'main', 'release-*' ]
pull_request:
branches: [ 'main', 'release-*' ]
workflow_call:

jobs:
git-lfs:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Pull request checks

on:
push:
branches: [ 'main', 'release-*' ]
pull_request:
branches: [ 'main', 'release-*' ]
workflow_call:

jobs:
test:
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/pull_request_integration_tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Pull request integration tests

on:
push:
branches: [ 'main', 'release-*' ]
pull_request:
branches: [ 'main', 'release-*' ]
workflow_call:

jobs:
test:
Expand Down Expand Up @@ -32,7 +29,7 @@ jobs:
uses: actions/upload-artifact@v4
if: always()
with:
name: Test Logs
name: Integration Test Logs
path: |
testoutput/*.log
testoutput/kind
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/pull_request_integration_tests_arm.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Pull request integration tests ARM

on:
push:
branches: [ 'main', 'release-*' ]
pull_request:
branches: [ 'main', 'release-*' ]
workflow_call:

jobs:
test:
Expand Down Expand Up @@ -32,7 +29,7 @@ jobs:
uses: actions/upload-artifact@v4
if: always()
with:
name: Test Logs
name: Integration Test Logs (ARM)
path: |
testoutput/*.log
testoutput/kind
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: Pull request integration tests on VM 5.15 x86_64

on:
push:
branches: [ 'main', 'release-*' ]
paths: [ 'bpf/**' ]
pull_request:
branches: [ 'main', 'release-*' ]
paths: [ 'bpf/**' ]
workflow_call:

jobs:
test:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
name: Pull request integration tests on VM 6.10 x86_64

on:
push:
branches: [ 'main', 'release-*' ]
paths: [ 'bpf/**' ]
pull_request:
branches: [ 'main', 'release-*' ]
paths: [ 'bpf/**' ]
workflow_call:

jobs:
test:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pull_request_k8s_integration_tests.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: Pull request K8s integration tests

on:
push:
branches: [ 'main', 'release-*' ]
pull_request:
branches: [ 'main', 'release-*' ]
workflow_call:

jobs:
test:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/pull_request_oats_test.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: PR OATS test

on:
push:
branches: [ 'main', 'release-*' ]
pull_request:
branches: [ 'main', 'release-*' ]
workflow_call:

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/workflow_integration_tests_vm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
uses: actions/upload-artifact@v4
if: always()
with:
name: Test Logs
name: Test Logs ${{ inputs.arch }}-${{ inputs.kernel-version }}
path: |
testoutput/*.log
testoutput/kind
Expand Down
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/generictracer/bpf_arm64_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/generictracer/bpf_debug_arm64_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/generictracer/bpf_debug_x86_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/generictracer/bpf_tp_arm64_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/generictracer/bpf_tp_debug_arm64_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/generictracer/bpf_tp_debug_x86_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/generictracer/bpf_tp_x86_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/generictracer/bpf_x86_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/gotracer/bpf_arm64_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/gotracer/bpf_debug_arm64_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/gotracer/bpf_debug_x86_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/gotracer/bpf_tp_arm64_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/gotracer/bpf_tp_debug_arm64_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/gotracer/bpf_tp_debug_x86_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/gotracer/bpf_tp_x86_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/gotracer/bpf_x86_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/gpuevent/bpf_arm64_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/gpuevent/bpf_debug_arm64_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/gpuevent/bpf_debug_x86_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/gpuevent/bpf_x86_bpfel.o
Git LFS file not shown
4 changes: 2 additions & 2 deletions pkg/internal/ebpf/httptracer/bpf_arm64_bpfel.o
Git LFS file not shown
Loading
Loading