-
Notifications
You must be signed in to change notification settings - Fork 55
150 lines (124 loc) · 5.07 KB
/
ubuntu_build_with_gtest.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: gtest
on:
# allow manually trigger
workflow_dispatch:
push:
branches:
- main
- 'maint-**'
pull_request:
branches:
- main
- 'maint-**'
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
# Customize the env if
BUILD_TYPE: Release
DPDK_VERSION: 23.11
TEST_PF_PORT_P: 0000:af:00.0
TEST_PF_PORT_R: 0000:af:00.0
TEST_PORT_P: 0000:af:01.2
TEST_PORT_R: 0000:af:01.3
TEST_DMA_PORT_P: 0000:80:04.0
TEST_DMA_PORT_R: 0000:80:04.1
permissions:
contents: read
jobs:
changes:
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
changed: ${{ steps.filter.outputs.linux_gtest == 'true' }}
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v2
id: filter
with:
filters: .github/path_filters.yml
Build:
needs: changes
if: ${{ github.repository == 'OpenVisualCloud/Media-Transport-Library' && needs.changes.outputs.changed == 'true' }}
runs-on: [Linux, self-hosted, DPDK]
timeout-minutes: 60
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Checkout IMTL
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Checkout DPDK
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
with:
repository: 'DPDK/dpdk'
ref: v${{ env.DPDK_VERSION }}
path: dpdk
- name: Install the build dependency
run: |
sudo apt-get install -y git gcc meson python3 python3-pyelftools pkg-config libnuma-dev libjson-c-dev libpcap-dev libgtest-dev libsdl2-dev libsdl2-ttf-dev libssl-dev
sudo apt-get install -y systemtap-sdt-dev
- name: Apply dpdk patches
run: |
cd dpdk
git am ../patches/dpdk/${{ env.DPDK_VERSION }}/*.patch
- name: Build dpdk
run: |
cd dpdk
meson build
ninja -C build
cd build
sudo ninja install
- name: Build
run: |
./build.sh
sudo ldconfig
Test:
needs: [changes, Build]
if: ${{ github.repository == 'OpenVisualCloud/Media-Transport-Library' && needs.changes.outputs.changed == 'true' }}
runs-on: [Linux, self-hosted, DPDK]
steps:
- name: Harden Runner
uses: step-security/harden-runner@0d381219ddf674d61a7572ddd19d7941e271515c # v2.9.0
with:
egress-policy: audit
- name: Kill previous gtest routine
run: |
sudo killall -SIGINT KahawaiTest || true
sudo killall -SIGINT KahawaiUfdTest || true
sudo killall -SIGINT KahawaiUplTest || true
sudo killall -SIGINT MtlManager || true
- name: Binding network adapter
run: |
sudo ./script/nicctl.sh create_vf ${{ env.TEST_PF_PORT_P }} || true
sudo ./dpdk/usertools/dpdk-devbind.py -b vfio-pci ${{ env.TEST_DMA_PORT_P }} || true
sudo ./dpdk/usertools/dpdk-devbind.py -b vfio-pci ${{ env.TEST_DMA_PORT_R }} || true
- name: Start MtlManager at background
run: |
sudo MtlManager &
- name: Run ufd test case
run: |
sudo ./build/tests/KahawaiUfdTest --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }}
- name: Run shared ufd test case
run: |
sudo ./build/tests/KahawaiUfdTest --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }} --queue_mode shared
- name: Run shared ufd test case with lcore
run: |
sudo ./build/tests/KahawaiUfdTest --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }} --queue_mode shared --udp_lcore
- name: Run ufd test case with rss
run: |
sudo ./build/tests/KahawaiUfdTest --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }} --rss_mode l3_l4
- name: Run udp ld preload test case
run: |
sudo MUFD_CFG=.github/workflows/upl_gtest.json LD_PRELOAD=/usr/local/lib/x86_64-linux-gnu/libmtl_udp_preload.so ./build/tests/KahawaiUplTest --p_sip 192.168.89.80 --r_sip 192.168.89.81
- name: Run st2110 test case
run: |
sudo ./build/tests/KahawaiTest --auto_start_stop --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }} --dma_dev ${{ env.TEST_DMA_PORT_P }},${{ env.TEST_DMA_PORT_R }} --gtest_filter=-St22_?x.*
- name: Run st2110 st20p test case in simulation ENA environment
run: |
sudo ./build/tests/KahawaiTest --auto_start_stop --p_port ${{ env.TEST_PORT_P }} --r_port ${{ env.TEST_PORT_R }} --rss_mode l3_l4 --pacing_way tsc --iova_mode pa --multi_src_port --gtest_filter=Main.*:St20p*:-*ext*
- name: Run st2110 st20p test case with kernel loopback
run: |
./build/tests/KahawaiTest --p_port kernel:lo --r_port kernel:lo --auto_start_stop --gtest_filter=St20p*