-
Notifications
You must be signed in to change notification settings - Fork 16
214 lines (184 loc) · 6.19 KB
/
pipeline.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
name: "P4 Control Plane CI Pipeline"
on:
push:
branches:
- main
- ipdk_v*
pull_request:
branches:
- main
- ipdk_v*
concurrency:
# If workflow for PR or push is already running, stop it and start a new one.
group: build-${{ github.ref }}
cancel-in-progress: true
permissions: read-all
env:
#---------------------------------------------------------------------
# Environment variables
#---------------------------------------------------------------------
SDE_REPOSITORY: ipdk-io/p4dev.dpdk-sde
SDE_TAG: 2023.10.1
SDE_FILENAME: dpdk-sde-dev-ubuntu-20.04.tar.gz
SDE_INSTALL_DIR: /opt/p4dev/dpdk-sde
DEPS_REPOSITORY: ipdk-io/stratum-deps
DEPS_TAG: v1.2.1
DEPS_FILENAME: deps-ubuntu-latest-x86_64.tar.gz
DEPS_INSTALL_DIR: /opt/p4dev/x86deps
PREREQS: libbsd-dev libnl-3-dev libnl-route-3-dev libnl-genl-3-dev
jobs:
#---------------------------------------------------------------------
# 1-build_dpdk_p4cp
#---------------------------------------------------------------------
build_dpdk_p4cp:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Clone networking-recipe
uses: actions/checkout@v4
with:
submodules: recursive
path: recipe
- name: Install prerequisites
run: |
sudo apt install $PREREQS
- name: Install DPDK SDE
uses: robinraju/[email protected]
with:
repository: ${{ env.SDE_REPOSITORY }}
tag: ${{ env.SDE_TAG }}
fileName: ${{ env.SDE_FILENAME }}
- run: |
sudo tar -xzf $SDE_FILENAME -C /
rm $SDE_FILENAME
- name: Install stratum dependencies
uses: robinraju/[email protected]
with:
repository: ${{ env.DEPS_REPOSITORY }}
tag: ${{ env.DEPS_TAG }}
fileName: ${{ env.DEPS_FILENAME }}
- run: |
sudo tar -xzf $DEPS_FILENAME -C /
rm $DEPS_FILENAME
- name: Build networking-recipe
working-directory: recipe
run: |
export DEPEND_INSTALL=$DEPS_INSTALL_DIR
export SDE_INSTALL=$SDE_INSTALL_DIR
./make-all.sh --target=dpdk --rpath
#---------------------------------------------------------------------
# 2-krnlmon_unit_tests
#---------------------------------------------------------------------
krnlmon_unit_tests:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Clone networking-recipe
uses: actions/checkout@v4
with:
submodules: recursive
path: recipe
- name: Install prerequisites
run: |
sudo apt install $PREREQS
- name: Install DPDK SDE
uses: robinraju/[email protected]
with:
repository: ${{ env.SDE_REPOSITORY }}
tag: ${{ env.SDE_TAG }}
fileName: ${{ env.SDE_FILENAME }}
- run: |
sudo tar -xzf $SDE_FILENAME -C /
rm $SDE_FILENAME
- name: Install stratum dependencies
uses: robinraju/[email protected]
with:
repository: ${{ env.DEPS_REPOSITORY }}
tag: ${{ env.DEPS_TAG }}
fileName: ${{ env.DEPS_FILENAME }}
- run: |
sudo tar -xzf $DEPS_FILENAME -C /
rm $DEPS_FILENAME
- name: Run krnlmon unit tests
working-directory: recipe/krnlmon/krnlmon
run: |
export DEPEND_INSTALL=$DEPS_INSTALL_DIR
export SDE_INSTALL=$SDE_INSTALL_DIR
cmake -S . -B build -DTDI_TARGET=DPDK
cmake --build build --target krnlmon-test
#---------------------------------------------------------------------
# 3-py_bandit_check
#---------------------------------------------------------------------
py_bandit_check:
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Clone networking-recipe
uses: actions/checkout@v4
with:
path: recipe
- name: Check p4rt-ctl
uses: tj-actions/[email protected]
with:
targets: | # or a single string "."
./recipe/clients/p4rt-ctl/p4rt-ctl.in
options: "-v"
#---------------------------------------------------------------------
# 4-build_p4runtime_protos
#---------------------------------------------------------------------
build_p4runtime_protos:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Clone networking-recipe
uses: actions/checkout@v4
with:
submodules: recursive
path: recipe
- name: Install prerequisites
run: |
sudo apt install $PREREQS
- name: Install python dependencies
working-directory: recipe
run: |
python -m pip install setuptools build wheel
- name: Set up Go environment
uses: actions/[email protected]
with:
go-version: 'stable'
- name: Install gRPC plugins
run: |
go install google.golang.org/protobuf/cmd/[email protected]
go install google.golang.org/grpc/cmd/[email protected]
- name: Install DPDK SDE
uses: robinraju/[email protected]
with:
repository: ${{ env.SDE_REPOSITORY }}
tag: ${{ env.SDE_TAG }}
fileName: ${{ env.SDE_FILENAME }}
- run: |
sudo tar -xzf $SDE_FILENAME -C /
rm $SDE_FILENAME
- name: Install stratum dependencies
uses: robinraju/[email protected]
with:
repository: ${{ env.DEPS_REPOSITORY }}
tag: ${{ env.DEPS_TAG }}
fileName: ${{ env.DEPS_FILENAME }}
- run: |
sudo tar -xzf $DEPS_FILENAME -C /
rm $DEPS_FILENAME
- name: Build protobufs in superproject
working-directory: recipe
run: |
export DEPEND_INSTALL=$DEPS_INSTALL_DIR
export SDE_INSTALL=$SDE_INSTALL_DIR
./make-all.sh --target=dpdk --no-ovs --no-build
cmake --build build --target protobufs
- name: Build protobufs in subdirectory
working-directory: recipe/protobufs
run: |
export DEPEND_INSTALL=$DEPS_INSTALL_DIR
cmake -B build
cmake --build build
cmake --install build --prefix install