-
-
Notifications
You must be signed in to change notification settings - Fork 75
103 lines (96 loc) · 3.84 KB
/
test-runtime.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
102
103
name: Build and test runtime
on:
workflow_dispatch:
push:
branches: "*"
pull_request:
branches: "master"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
cancel-in-progress: true
jobs:
build:
runs-on: "ubuntu-latest"
strategy:
matrix:
container:
- ubuntu-2204
- fedora-39
container:
image: "manjusakalza/bpftime-base-image:${{matrix.container}}"
options: --privileged
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Remount shm dev
# The size of /dev/shm defaults to be 64M, but boost won't detect this at all, leaving bus error to us..
# So we remount it to make it larger
run: |
mount -o remount,size=1G /dev/shm
- name: Install lcov
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
run: |
cmake -DTEST_LCOV=ON -DBPFTIME_LLVM_JIT=YES -DBPFTIME_ENABLE_UNIT_TESTING=YES -DCMAKE_BUILD_TYPE=Debug -B build
cmake --build build --config Debug --target bpftime_runtime_tests -j$(nproc)
- name: Test Runtime
run: ./build/runtime/unit-test/bpftime_runtime_tests
- name: Generate runtime coverage (Ubuntu)
if: "matrix.container == 'ubuntu-2204'"
run: |
lcov --capture --directory . --output-file coverage-runtime.info --gcov-tool $(which gcov-12)
lcov --remove coverage-runtime.info '/usr/*' --output-file coverage-runtime.info
lcov --list coverage-runtime.info
- name: Generate runtime coverage (Fedora)
if: "matrix.container == 'fedora-39'"
run: |
lcov --capture --directory . --output-file coverage-runtime.info
lcov --remove coverage-runtime.info '/usr/*' --output-file coverage-runtime.info
lcov --list coverage-runtime.info
- name: Upload runtime coverage
uses: actions/upload-artifact@v4
with:
name: coverage-runtime-${{matrix.container}}
include-hidden-files: false
path: |
./coverage-runtime.info
- name: build runtime with mpk enable
run: |
rm -rf build
cmake -Bbuild -DTEST_LCOV=ON -DBPFTIME_LLVM_JIT=YES -DBPFTIME_ENABLE_UNIT_TESTING=YES -DBPFTIME_ENABLE_MPK=YES -DCMAKE_BUILD_TYPE=Debug
cmake --build build --config Debug --target bpftime_runtime_tests -j$(nproc)
- name: test runtime with mpk
run: ./build/runtime/unit-test/bpftime_runtime_tests
- name: Generate runtime with mpk enable coverage (Ubuntu)
if: "matrix.container == 'ubuntu-2204'"
run: |
lcov --capture --directory . --output-file coverage-runtime-mpk.info --gcov-tool $(which gcov-12)
lcov --remove coverage-runtime-mpk.info '/usr/*' --output-file coverage-runtime-mpk.info
lcov --list coverage-runtime-mpk.info
- name: Generate runtime with mpk enable coverage (Fedora)
if: "matrix.container == 'fedora-39'"
run: |
lcov --capture --directory . --output-file coverage-runtime-mpk.info
lcov --remove coverage-runtime-mpk.info '/usr/*' --output-file coverage-runtime-mpk.info
lcov --list coverage-runtime-mpk.info
- name: Upload runtime-mpk coverage
uses: actions/upload-artifact@v4
with:
name: coverage-runtime-mpk-${{matrix.container}}
include-hidden-files: false
path: |
./coverage-runtime-mpk.info
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true # optional (default = false)
files: ./coverage-runtime.info
flags: runtime tests
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)