]>
Commit | Line | Data |
---|---|---|
6cb2f5a6 IM |
1 | name: Build and Test |
2 | ||
3 | on: [push, pull_request] | |
4 | ||
5 | jobs: | |
6 | build-linux: | |
7 | env: | |
8 | dependencies: | | |
9 | automake libtool gcc bc libjemalloc1 libjemalloc-dev \ | |
10 | libssl-dev llvm-dev libelf-dev libnuma-dev libpcap-dev \ | |
252e1e57 IS |
11 | ninja-build python3-openssl python3-pip \ |
12 | python3-setuptools python3-sphinx python3-wheel \ | |
6cb2f5a6 IM |
13 | selinux-policy-dev |
14 | deb_dependencies: | | |
15 | linux-headers-$(uname -r) build-essential fakeroot devscripts equivs | |
16 | AFXDP: ${{ matrix.afxdp }} | |
17 | CC: ${{ matrix.compiler }} | |
18 | DEB_PACKAGE: ${{ matrix.deb_package }} | |
19 | DPDK: ${{ matrix.dpdk }} | |
20 | DPDK_SHARED: ${{ matrix.dpdk_shared }} | |
21 | KERNEL: ${{ matrix.kernel }} | |
22 | KERNEL_LIST: ${{ matrix.kernel_list }} | |
23 | LIBS: ${{ matrix.libs }} | |
24 | M32: ${{ matrix.m32 }} | |
25 | OPTS: ${{ matrix.opts }} | |
26 | TESTSUITE: ${{ matrix.testsuite }} | |
27 | ||
28 | name: linux ${{ join(matrix.*, ' ') }} | |
29 | runs-on: ubuntu-18.04 | |
30 | timeout-minutes: 30 | |
31 | ||
32 | strategy: | |
33 | fail-fast: false | |
34 | matrix: | |
35 | include: | |
36 | - compiler: gcc | |
37 | opts: --disable-ssl | |
38 | - compiler: clang | |
39 | opts: --disable-ssl | |
40 | ||
41 | - compiler: gcc | |
42 | testsuite: test | |
43 | kernel: 3.16 | |
44 | - compiler: clang | |
45 | testsuite: test | |
46 | kernel: 3.16 | |
47 | ||
48 | - compiler: gcc | |
49 | testsuite: test | |
50 | opts: --enable-shared | |
51 | - compiler: clang | |
52 | testsuite: test | |
53 | opts: --enable-shared | |
54 | ||
55 | - compiler: gcc | |
56 | testsuite: test | |
57 | dpdk: dpdk | |
58 | - compiler: clang | |
59 | testsuite: test | |
60 | dpdk: dpdk | |
61 | ||
62 | - compiler: gcc | |
63 | testsuite: test | |
64 | libs: -ljemalloc | |
65 | - compiler: clang | |
66 | testsuite: test | |
67 | libs: -ljemalloc | |
68 | ||
69 | - compiler: gcc | |
70 | kernel_list: 5.8 5.5 5.4 4.19 | |
71 | - compiler: clang | |
72 | kernel_list: 5.8 5.5 5.4 4.19 | |
73 | ||
74 | - compiler: gcc | |
75 | kernel_list: 4.14 4.9 4.4 3.16 | |
76 | - compiler: clang | |
77 | kernel_list: 4.14 4.9 4.4 3.16 | |
78 | ||
79 | - compiler: gcc | |
80 | afxdp: afxdp | |
81 | kernel: 5.3 | |
82 | - compiler: clang | |
83 | afxdp: afxdp | |
84 | kernel: 5.3 | |
85 | ||
86 | - compiler: gcc | |
87 | dpdk: dpdk | |
88 | opts: --enable-shared | |
89 | - compiler: clang | |
90 | dpdk: dpdk | |
91 | opts: --enable-shared | |
92 | ||
93 | - compiler: gcc | |
94 | dpdk_shared: dpdk-shared | |
95 | - compiler: clang | |
96 | dpdk_shared: dpdk-shared | |
97 | ||
98 | - compiler: gcc | |
99 | dpdk_shared: dpdk-shared | |
100 | opts: --enable-shared | |
101 | - compiler: clang | |
102 | dpdk_shared: dpdk-shared | |
103 | opts: --enable-shared | |
104 | ||
105 | - compiler: gcc | |
106 | m32: m32 | |
107 | opts: --disable-ssl | |
108 | ||
109 | - compiler: gcc | |
110 | deb_package: deb | |
111 | ||
112 | steps: | |
113 | - name: checkout | |
114 | uses: actions/checkout@v2 | |
115 | ||
116 | - name: create ci signature file for the dpdk cache key | |
117 | if: matrix.dpdk != '' || matrix.dpdk_shared != '' | |
118 | # This will collect most of DPDK related lines, so hash will be different | |
119 | # if something changed in a way we're building DPDK including DPDK_VER. | |
120 | # This also allows us to use cache from any branch as long as version | |
121 | # and a way we're building DPDK stays the same. | |
122 | run: | | |
123 | grep -irE 'RTE_|DPDK|meson|ninja' -r .ci/ > dpdk-ci-signature | |
124 | cat dpdk-ci-signature | |
125 | ||
126 | - name: cache | |
127 | if: matrix.dpdk != '' || matrix.dpdk_shared != '' | |
128 | uses: actions/cache@v2 | |
129 | env: | |
130 | matrix_key: ${{ matrix.dpdk }}${{ matrix.dpdk_shared }} | |
131 | ci_key: ${{ hashFiles('dpdk-ci-signature') }} | |
132 | with: | |
133 | path: dpdk-dir | |
134 | key: ${{ env.matrix_key }}-${{ env.ci_key }} | |
135 | ||
02f76fb4 | 136 | - name: update APT cache |
7e9dc871 | 137 | run: sudo apt update || true |
6cb2f5a6 IM |
138 | - name: install common dependencies |
139 | if: matrix.deb_package == '' | |
140 | run: sudo apt install -y ${{ env.dependencies }} | |
141 | - name: install dependencies for debian packages | |
142 | if: matrix.deb_package != '' | |
143 | run: sudo apt install -y ${{ env.deb_dependencies }} | |
144 | - name: install libunbound libunwind | |
145 | if: matrix.m32 == '' | |
146 | run: sudo apt install -y libunbound-dev libunwind-dev | |
147 | ||
148 | - name: prepare | |
149 | run: ./.ci/linux-prepare.sh | |
150 | ||
151 | - name: build | |
252e1e57 | 152 | run: PATH="$PATH:$HOME/bin:$HOME/.local/bin" ./.ci/linux-build.sh |
6cb2f5a6 IM |
153 | |
154 | - name: upload deb packages | |
155 | if: matrix.deb_package != '' | |
156 | uses: actions/upload-artifact@v2 | |
157 | with: | |
158 | name: deb-packages | |
159 | path: '/home/runner/work/ovs/*.deb' | |
160 | ||
161 | - name: copy logs on failure | |
162 | if: failure() || cancelled() | |
163 | run: | | |
164 | # upload-artifact@v2 throws exceptions if it tries to upload socket | |
165 | # files and we could have some socket files in testsuite.dir. | |
166 | # Also, upload-artifact@v2 doesn't work well enough with wildcards. | |
167 | # So, we're just archiving everything here to avoid any issues. | |
168 | mkdir logs | |
169 | cp config.log ./logs/ | |
170 | cp -r ./*/_build/sub/tests/testsuite.* ./logs/ || true | |
171 | tar -czvf logs.tgz logs/ | |
172 | ||
173 | - name: upload logs on failure | |
174 | if: failure() || cancelled() | |
175 | uses: actions/upload-artifact@v2 | |
176 | with: | |
177 | name: logs-linux-${{ join(matrix.*, '-') }} | |
178 | path: logs.tgz | |
179 | ||
180 | build-osx: | |
181 | env: | |
182 | CC: clang | |
183 | OPTS: --disable-ssl | |
184 | ||
185 | name: osx clang --disable-ssl | |
186 | runs-on: macos-latest | |
187 | timeout-minutes: 30 | |
188 | ||
189 | strategy: | |
190 | fail-fast: false | |
191 | ||
192 | steps: | |
193 | - name: checkout | |
194 | uses: actions/checkout@v2 | |
195 | - name: install dependencies | |
196 | run: brew install automake libtool | |
197 | - name: prepare | |
198 | run: ./.ci/osx-prepare.sh | |
199 | - name: build | |
200 | run: PATH="$PATH:$HOME/bin" ./.ci/osx-build.sh | |
201 | - name: upload logs on failure | |
202 | if: failure() | |
203 | uses: actions/upload-artifact@v2 | |
204 | with: | |
205 | name: logs-osx-clang---disable-ssl | |
206 | path: config.log |