-
Notifications
You must be signed in to change notification settings - Fork 9
93 lines (87 loc) · 3.34 KB
/
bcc-test.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
name: BCC Build and tests
on: push
jobs:
test_bcc:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04] # 18.04.3 release has 5.0.0 kernel
env:
- TYPE: Debug
PYTHON_TEST_LOGFILE: critical.log
- TYPE: Release
PYTHON_TEST_LOGFILE: critical.log
steps:
- uses: actions/checkout@v2
- name: System info
run: |
uname -a
ip addr
- name: Build docker container with all deps
run: |
docker build -t bcc-docker -f Dockerfile.tests .
- name: Run bcc build
env: ${{ matrix.env }}
run: |
/bin/bash -c \
"docker run --privileged \
--pid=host \
-v $(pwd):/bcc \
-v /sys/kernel/debug:/sys/kernel/debug:rw \
-v /lib/modules:/lib/modules:ro \
-v /usr/src:/usr/src:ro \
-v /usr/include/linux:/usr/include/linux:ro \
bcc-docker \
/bin/bash -c \
'mkdir -p /bcc/build && cd /bcc/build && \
cmake -DCMAKE_BUILD_TYPE=${TYPE} .. && make -j9'"
- name: Run bcc's cc tests
env: ${{ matrix.env }}
# tests are wrapped with `script` as a hack to get a TTY as github actions doesn't provide this
# see https://github.com/actions/runner/issues/241
run: |
script -e -c /bin/bash -c \
"docker run -ti \
--privileged \
--network=host \
--pid=host \
-v $(pwd):/bcc \
-v /sys/kernel/debug:/sys/kernel/debug:rw \
-v /lib/modules:/lib/modules:ro \
-v /usr/src:/usr/src:ro \
-e CTEST_OUTPUT_ON_FAILURE=1 \
bcc-docker \
/bin/bash -c \
'/bcc/build/tests/wrapper.sh \
c_test_all sudo /bcc/build/tests/cc/test_libbcc'"
- name: Run all tests
env: ${{ matrix.env }}
run: |
script -e -c /bin/bash -c \
"docker run -ti \
--privileged \
--network=host \
--pid=host \
-v $(pwd):/bcc \
-v /sys/kernel/debug:/sys/kernel/debug:rw \
-v /lib/modules:/lib/modules:ro \
-v /usr/src:/usr/src:ro \
-e CTEST_OUTPUT_ON_FAILURE=1 \
bcc-docker \
/bin/bash -c \
'cd /bcc/build && \
make test PYTHON_TEST_LOGFILE=$PYTHON_TEST_LOGFILE ARGS=-V'"
- name: Check critical tests
env: ${{ matrix.env }}
run: |
critical_count=$(grep @mayFail tests/python/critical.log | wc -l)
echo "There were $critical_count critical tests skipped with @mayFail:"
grep -A2 @mayFail tests/python/critical.log
- uses: actions/upload-artifact@v1
with:
name: critical-tests-${{ matrix.env['TYPE'] }}-${{ matrix.os }}
path: tests/python/critical.log
# To debug weird issues, you can add this step to be able to SSH to the test environment
# https://github.com/marketplace/actions/debugging-with-tmate
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v1