-
-
Notifications
You must be signed in to change notification settings - Fork 84
101 lines (94 loc) · 4.01 KB
/
test-attach.yml
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Build and Attach Tests Workflow
on:
workflow_dispatch:
push:
branches: "*"
pull_request:
branches: "master"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
build_and_test_attach:
runs-on: "ubuntu-latest"
strategy:
matrix:
container:
- ubuntu-2204
- fedora-39
container:
image: "manjusakalza/bpftime-base-image:${{matrix.container}}"
options: --privileged -v /sys/kernel/debug/:/sys/kernel/debug:rw -v /sys/kernel/tracing:/sys/kernel/tracing:rw
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install dependencies
if: "matrix.container == 'ubuntu-2204'"
run: |
apt-get install -y lcov libzstd-dev libboost-all-dev gpg
- name: Install lcov
if: "matrix.container == 'fedora-39'"
run: |
dnf install -y lcov
- name: Build for frida uprobe attach tests
run: |
cmake -DTEST_LCOV=ON -B build
cmake --build build --config Debug --target bpftime_frida_uprobe_attach_tests -j$(nproc)
- name: Run frida uprobe attach tests
run: |
./build/attach/frida_uprobe_attach_impl/bpftime_frida_uprobe_attach_tests
- name: Generate frida uprobe attach test coverage (Fedora)
if: "matrix.container == 'fedora-39'"
run: |
lcov --capture --directory . --output-file coverage-uprobe.info
lcov --remove coverage-uprobe.info '/usr/*' --output-file coverage-uprobe.info
lcov --list coverage-uprobe.info
- name: Generate frida uprobe attach test coverage (Ubuntu)
if: "matrix.container == 'ubuntu-2204'"
run: |
lcov --capture --directory . --output-file coverage-uprobe.info --gcov-tool $(which gcov-12)
lcov --remove coverage-uprobe.info '/usr/*' --output-file coverage-uprobe.info
lcov --list coverage-uprobe.info
- name: Upload uprobe coverage
uses: actions/upload-artifact@v4
with:
name: coverage-uprobe-${{matrix.container}}
include-hidden-files: false
path: |
./coverage-uprobe.info
- name: Remove the build
run: rm -rf build
- name: Build syscall trace uprobe attach tests
run: |
cmake -DTEST_LCOV=ON -B build
cmake --build build --config Debug --target bpftime_syscall_trace_attach_tests -j$(nproc)
- name: Run syscall trace uprobe attach tests
run: |
./build/attach/syscall_trace_attach_impl/bpftime_syscall_trace_attach_tests
- name: Generate syscall trace uprobe attach coverage (Ubuntu)
if: "matrix.container == 'ubuntu-2204'"
run: |
lcov --capture --directory . --output-file coverage-syscall-trace.info --gcov-tool $(which gcov-12)
lcov --remove coverage-syscall-trace.info '/usr/*' --output-file coverage-syscall-trace.info
lcov --list coverage-syscall-trace.info
- name: Generate syscall trace uprobe attach coverage (Fedora)
if: "matrix.container == 'fedora-39'"
run: |
lcov --capture --directory . --output-file coverage-syscall-trace.info
lcov --remove coverage-syscall-trace.info '/usr/*' --output-file coverage-syscall-trace.info
lcov --list coverage-syscall-trace.info
- name: Upload uprobe coverage
uses: actions/upload-artifact@v4
with:
name: coverage-syscall-trace-${{matrix.container}}
include-hidden-files: false
path: |
./coverage-syscall-trace.info
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true # optional (default = false)
files: ./coverage-syscall-trace.info, ./coverage-uprobe.info # optional
flags: attach tests (uprobe & syscall trace)
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)