-
-
Notifications
You must be signed in to change notification settings - Fork 4
71 lines (61 loc) · 1.98 KB
/
test-vm.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
name: Build and Test VM
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
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:
- name: cache dependencies
uses: actions/cache@v2
id: cache
with:
path: ${{ github.workspace }}/${{ env.INSTALL_LOCATION }}
key: ${{ runner.os }}-dependencies
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: Install Ninja and lcov (Ubuntu)
if: ${{matrix.container == 'ubuntu-2204'}}
run:
apt install -y ninja-build lcov gcc-11
- name: Install Ninja and lcov (Fedora)
if: ${{matrix.container == 'fedora-39'}}
run:
dnf install -y ninja-build lcov
- uses: actions/setup-python@v4
if: startsWith(matrix.container,'ubuntu')
with:
python-version: '3.8'
- name: build
run:
|
cmake -B build -DCMAKE_BUILD_TYPE=Debug -DBPFTIME_ENABLE_UNIT_TESTING=1 -DBPFTIME_ENABLE_CODE_COVERAGE=1 -G Ninja
cmake --build build --target all -j
- name: run testsuit x86
shell: bash
run: |
python3.8 -m venv ./test
source test/bin/activate
pip install -r test/requirements.txt
# make build # or build-arm32 build-arm64
pytest -v -s test/test_framework
- name: upload coverage
run: |
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter system-files
lcov --list coverage.info # debug info
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"