-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scripts to setup and run the tests on CI. === Note on bpftrace Using bpftrace -c doesn't work for these tests, when there are tracepoints refering to dynamic libraries. This is because the .so is not loaded yet when bpftrace attempts to attach. In run_test.sh bpftrace terminates at the end of target test program. After that test output is compared.
- Loading branch information
Showing
6 changed files
with
101 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
BPFTRACE_VERSION=${BPFTRACE_VERSION:-0.22.1} | ||
|
||
# Assume sudo in this script | ||
|
||
# Install dependencies | ||
apt update && apt install -y make file gawk libfuse2t64 | ||
|
||
# Download bpftrace release | ||
BIN_DIR=/usr/local/bin | ||
mkdir -p $BIN_DIR | ||
curl -L -o bpftrace https://github.com/bpftrace/bpftrace/releases/download/v${BPFTRACE_VERSION}/bpftrace | ||
chmod +x bpftrace | ||
mv bpftrace $BIN_DIR | ||
bpftrace --version | ||
|
||
# mount tracefs to avoid warnings from bpftrace | ||
grep -q tracefs /proc/mounts || mount -t tracefs tracefs /sys/kernel/tracing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: USDT CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install prerequisites | ||
run: sudo .github/scripts/setup.sh | ||
|
||
- name: Build (static) | ||
run: make SHARED=0 -C tests -j$(nproc) build | ||
|
||
- name: Build (shared) | ||
run: make SHARED=1 -C tests -j$(nproc) build | ||
|
||
- name: Test (static) | ||
run: make SHARED=0 -C tests test | ||
|
||
- name: Test (shared) | ||
run: make SHARED=1 -C tests test | ||
|
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters