10 shell: bash --noprofile --norc -exo pipefail {0}
14 name: ${{ join(matrix.config.*, '-') }}
15 runs-on: ${{ matrix.config.os }}
17 AARCH64: ${{ matrix.config.cross == 'aarch64' }}
18 ABI_CHECKS: ${{ contains(matrix.config.checks, 'abi') }}
19 ASAN: ${{ contains(matrix.config.checks, 'asan') }}
20 BUILD_32BIT: ${{ matrix.config.cross == 'i386' }}
21 BUILD_DOCS: ${{ contains(matrix.config.checks, 'doc') }}
22 CC: ccache ${{ matrix.config.compiler }}
23 DEF_LIB: ${{ matrix.config.library }}
24 LIBABIGAIL_VERSION: libabigail-1.8
25 MINGW: ${{ matrix.config.cross == 'mingw' }}
26 MINI: ${{ matrix.config.mini != '' }}
27 PPC64LE: ${{ matrix.config.cross == 'ppc64le' }}
29 RISCV64: ${{ matrix.config.cross == 'riscv64' }}
30 RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }}
53 checks: asan+doc+tests
84 - name: Checkout sources
85 uses: actions/checkout@v2
86 - name: Generate cache keys
89 echo -n '::set-output name=ccache::'
90 echo 'ccache-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-'$(date -u +%Y-w%W)
91 echo -n '::set-output name=libabigail::'
92 echo 'libabigail-${{ matrix.config.os }}'
93 echo -n '::set-output name=abi::'
94 echo 'abi-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-${{ env.LIBABIGAIL_VERSION }}-${{ env.REF_GIT_TAG }}'
95 - name: Retrieve ccache cache
96 uses: actions/cache@v2
99 key: ${{ steps.get_ref_keys.outputs.ccache }}-${{ github.ref }}
101 ${{ steps.get_ref_keys.outputs.ccache }}-refs/heads/main
102 - name: Retrieve libabigail cache
104 uses: actions/cache@v2
105 if: env.ABI_CHECKS == 'true'
108 key: ${{ steps.get_ref_keys.outputs.libabigail }}
109 - name: Retrieve ABI reference cache
110 uses: actions/cache@v2
111 if: env.ABI_CHECKS == 'true'
114 key: ${{ steps.get_ref_keys.outputs.abi }}
115 - name: Update APT cache
116 run: sudo apt update || true
117 - name: Install packages
118 run: sudo apt install -y ccache libnuma-dev python3-setuptools
119 python3-wheel python3-pip python3-pyelftools ninja-build libbsd-dev
120 libpcap-dev libibverbs-dev libcrypto++-dev libfdt-dev libjansson-dev
122 - name: Install libabigail build dependencies if no cache is available
123 if: env.ABI_CHECKS == 'true' && steps.libabigail-cache.outputs.cache-hit != 'true'
124 run: sudo apt install -y autoconf automake libtool pkg-config libxml2-dev
126 - name: Install i386 cross compiling packages
127 if: env.BUILD_32BIT == 'true'
128 run: sudo apt install -y gcc-multilib g++-multilib
129 - name: Install aarch64 cross compiling packages
130 if: env.AARCH64 == 'true'
131 run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
132 pkg-config-aarch64-linux-gnu
133 - name: Install mingw cross compiling packages
134 if: env.MINGW == 'true'
135 run: sudo apt install -y mingw-w64 mingw-w64-tools
136 - name: Install ppc64le cross compiling packages
137 if: env.PPC64LE == 'true'
138 run: sudo apt install -y gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross
139 pkg-config-powerpc-linux-gnu
140 - name: Install riscv64 cross compiling packages
141 if: env.RISCV64 == 'true'
142 run: sudo apt install -y crossbuild-essential-riscv64
143 - name: Install test tools packages
144 if: env.AARCH64 != 'true' || env.PPC64LE != 'true' || env.RISCV64 != 'true' || env.RUN_TESTS == 'true'
145 run: sudo apt install -y gdb
146 - name: Install doc generation packages
147 if: env.BUILD_DOCS == 'true'
148 run: sudo apt install -y doxygen graphviz python3-sphinx
149 python3-sphinx-rtd-theme
153 # Workaround on $HOME permissions as EAL checks them for plugin loading
155 - name: Build and test
156 run: .ci/linux-build.sh
157 - name: Upload logs on failure
159 uses: actions/upload-artifact@v2
161 name: meson-logs-${{ join(matrix.config.*, '-') }}
165 build/meson-logs/meson-log.txt
166 build/meson-logs/testlog.txt
168 prepare-container-images:
169 name: ${{ join(matrix.config.*, '-') }}
170 runs-on: ubuntu-latest
179 - name: Generate various keys
182 echo -n '::set-output name=image::'
183 echo 'image-${{ matrix.config.image }}-'$(date -u +%Y-%m-%d)
184 - name: Retrieve image cache
186 uses: actions/cache@v2
189 key: ${{ steps.get_keys.outputs.image }}
190 - name: Pull and prepare a fresh image
191 if: steps.image_cache.outputs.cache-hit != 'true'
193 docker pull registry.fedoraproject.org/${{ matrix.config.image }}
194 docker run -d -i --rm --name dpdk \
195 registry.fedoraproject.org/${{ matrix.config.image }} \
198 if: steps.image_cache.outputs.cache-hit != 'true'
199 run: docker exec -i dpdk dnf update -y
200 - name: Install packages
201 if: steps.image_cache.outputs.cache-hit != 'true'
202 run: docker exec -i dpdk dnf install -y ccache numactl-devel
203 python3-setuptools python3-wheel python3-pip python3-pyelftools
204 ninja-build libatomic libbpf-devel libfdt-devel libpcap-devel
205 openssl-devel rdma-core-devel zlib-devel
206 - name: Save image in cache
207 if: steps.image_cache.outputs.cache-hit != 'true'
209 docker commit dpdk dpdk-local
211 docker save -o ~/.image/${{ matrix.config.image }}.tar dpdk-local
213 if: steps.image_cache.outputs.cache-hit != 'true'
214 run: docker kill dpdk
216 rpm-container-builds:
217 needs: prepare-container-images
218 name: ${{ join(matrix.config.*, '-') }}
219 runs-on: ubuntu-latest
239 - name: Checkout sources
240 uses: actions/checkout@v2
241 - name: Generate various keys
244 echo -n '::set-output name=ccache::'
245 echo 'ccache-${{ matrix.config.image }}-${{ matrix.config.compiler }}-'$(date -u +%Y-w%W)
246 echo -n '::set-output name=image::'
247 echo 'image-${{ matrix.config.image }}-'$(date -u +%Y-%m-%d)
248 echo -n '::set-output name=logs::'
249 echo 'meson-logs-${{ join(matrix.config.*, '-') }}' | tr -d ':'
250 - name: Retrieve image cache
252 uses: actions/cache@v2
255 key: ${{ steps.get_keys.outputs.image }}
256 - name: Fail if no image (not supposed to happen)
257 if: steps.image_cache.outputs.cache-hit != 'true'
259 echo 'Image ${{ matrix.config.image }} is not cached.'
261 - name: Retrieve ccache cache
262 uses: actions/cache@v2
265 key: ${{ steps.get_keys.outputs.ccache }}-${{ github.ref }}
267 ${{ steps.get_keys.outputs.ccache }}-refs/heads/main
268 - name: Prepare working directory
272 echo CC=ccache ${{ matrix.config.compiler }} >> ~/env
273 echo DEF_LIB=${{ matrix.config.library }} >> ~/env
274 - name: Load the cached image
276 docker load -i ~/.image/${{ matrix.config.image }}.tar
277 docker run -d -i --rm --name dpdk \
278 --mount type=bind,src=$HOME/.ccache,dst=/root/.ccache \
279 --mount type=bind,src=$(pwd),dst=/root/dpdk \
285 run: docker exec -i dpdk dnf update -y || true
286 - name: Install packages
287 run: docker exec -i dpdk dnf install -y ccache numactl-devel
288 python3-setuptools python3-wheel python3-pip python3-pyelftools
289 ninja-build libatomic libbpf-devel libfdt-devel libpcap-devel
290 openssl-devel rdma-core-devel zlib-devel ${{ matrix.config.compiler }}
292 run: docker exec -i dpdk .ci/linux-setup.sh
294 run: docker exec -i dpdk .ci/linux-build.sh
296 run: docker kill dpdk
297 - name: Upload logs on failure
299 uses: actions/upload-artifact@v2
301 name: ${{ steps.get_keys.outputs.logs }}
304 build/meson-logs/meson-log.txt