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 BUILD_32BIT: ${{ matrix.config.cross == 'i386' }}
20 BUILD_DOCS: ${{ contains(matrix.config.checks, 'doc') }}
21 CC: ccache ${{ matrix.config.compiler }}
22 DEF_LIB: ${{ matrix.config.library }}
23 LIBABIGAIL_VERSION: libabigail-1.8
24 MINGW: ${{ matrix.config.cross == 'mingw' }}
25 MINI: ${{ matrix.config.mini != '' }}
26 PPC64LE: ${{ matrix.config.cross == 'ppc64le' }}
28 RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }}
78 - name: Checkout sources
79 uses: actions/checkout@v2
80 - name: Generate cache keys
83 echo -n '::set-output name=ccache::'
84 echo 'ccache-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-'$(date -u +%Y-w%W)
85 echo -n '::set-output name=libabigail::'
86 echo 'libabigail-${{ matrix.config.os }}'
87 echo -n '::set-output name=abi::'
88 echo 'abi-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-${{ env.LIBABIGAIL_VERSION }}-${{ env.REF_GIT_TAG }}'
89 - name: Retrieve ccache cache
90 uses: actions/cache@v2
93 key: ${{ steps.get_ref_keys.outputs.ccache }}-${{ github.ref }}
95 ${{ steps.get_ref_keys.outputs.ccache }}-refs/heads/main
96 - name: Retrieve libabigail cache
98 uses: actions/cache@v2
99 if: env.ABI_CHECKS == 'true'
102 key: ${{ steps.get_ref_keys.outputs.libabigail }}
103 - name: Retrieve ABI reference cache
104 uses: actions/cache@v2
105 if: env.ABI_CHECKS == 'true'
108 key: ${{ steps.get_ref_keys.outputs.abi }}
109 - name: Update APT cache
110 run: sudo apt update || true
111 - name: Install packages
112 run: sudo apt install -y ccache libnuma-dev python3-setuptools
113 python3-wheel python3-pip python3-pyelftools ninja-build libbsd-dev
114 libpcap-dev libibverbs-dev libcrypto++-dev libfdt-dev libjansson-dev
116 - name: Install libabigail build dependencies if no cache is available
117 if: env.ABI_CHECKS == 'true' && steps.libabigail-cache.outputs.cache-hit != 'true'
118 run: sudo apt install -y autoconf automake libtool pkg-config libxml2-dev
120 - name: Install i386 cross compiling packages
121 if: env.BUILD_32BIT == 'true'
122 run: sudo apt install -y gcc-multilib g++-multilib
123 - name: Install aarch64 cross compiling packages
124 if: env.AARCH64 == 'true'
125 run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
126 pkg-config-aarch64-linux-gnu
127 - name: Install mingw cross compiling packages
128 if: env.MINGW == 'true'
129 run: sudo apt install -y mingw-w64 mingw-w64-tools
130 - name: Install ppc64le cross compiling packages
131 if: env.PPC64LE == 'true'
132 run: sudo apt install -y gcc-powerpc64le-linux-gnu libc6-dev-ppc64el-cross
133 pkg-config-powerpc-linux-gnu
134 - name: Install test tools packages
135 if: env.AARCH64 != 'true' || env.PPC64LE != 'true' || env.RUN_TESTS == 'true'
136 run: sudo apt install -y gdb
137 - name: Install doc generation packages
138 if: env.BUILD_DOCS == 'true'
139 run: sudo apt install -y doxygen graphviz python3-sphinx
140 python3-sphinx-rtd-theme
144 # Workaround on $HOME permissions as EAL checks them for plugin loading
146 - name: Build and test
147 run: .ci/linux-build.sh
148 - name: Upload logs on failure
150 uses: actions/upload-artifact@v2
152 name: meson-logs-${{ join(matrix.config.*, '-') }}
156 build/meson-logs/meson-log.txt
157 build/meson-logs/testlog.txt
159 prepare-container-images:
160 name: ${{ join(matrix.config.*, '-') }}
161 runs-on: ubuntu-latest
170 - name: Generate various keys
173 echo -n '::set-output name=image::'
174 echo 'image-${{ matrix.config.image }}-'$(date -u +%Y-%m-%d)
175 - name: Retrieve image cache
177 uses: actions/cache@v2
180 key: ${{ steps.get_keys.outputs.image }}
181 - name: Pull and prepare a fresh image
182 if: steps.image_cache.outputs.cache-hit != 'true'
184 docker pull registry.fedoraproject.org/${{ matrix.config.image }}
185 docker run -d -i --rm --name dpdk \
186 registry.fedoraproject.org/${{ matrix.config.image }} \
189 if: steps.image_cache.outputs.cache-hit != 'true'
190 run: docker exec -i dpdk dnf update -y
191 - name: Install packages
192 if: steps.image_cache.outputs.cache-hit != 'true'
193 run: docker exec -i dpdk dnf install -y ccache numactl-devel
194 python3-setuptools python3-wheel python3-pip python3-pyelftools
195 ninja-build libatomic libbpf-devel libfdt-devel libpcap-devel
196 openssl-devel rdma-core-devel zlib-devel
197 - name: Save image in cache
198 if: steps.image_cache.outputs.cache-hit != 'true'
200 docker commit dpdk dpdk-local
202 docker save -o ~/.image/${{ matrix.config.image }}.tar dpdk-local
204 if: steps.image_cache.outputs.cache-hit != 'true'
205 run: docker kill dpdk
207 rpm-container-builds:
208 needs: prepare-container-images
209 name: ${{ join(matrix.config.*, '-') }}
210 runs-on: ubuntu-latest
230 - name: Checkout sources
231 uses: actions/checkout@v2
232 - name: Generate various keys
235 echo -n '::set-output name=ccache::'
236 echo 'ccache-${{ matrix.config.image }}-${{ matrix.config.compiler }}-'$(date -u +%Y-w%W)
237 echo -n '::set-output name=image::'
238 echo 'image-${{ matrix.config.image }}-'$(date -u +%Y-%m-%d)
239 echo -n '::set-output name=logs::'
240 echo 'meson-logs-${{ join(matrix.config.*, '-') }}' | tr -d ':'
241 - name: Retrieve image cache
243 uses: actions/cache@v2
246 key: ${{ steps.get_keys.outputs.image }}
247 - name: Fail if no image (not supposed to happen)
248 if: steps.image_cache.outputs.cache-hit != 'true'
250 echo 'Image ${{ matrix.config.image }} is not cached.'
252 - name: Retrieve ccache cache
253 uses: actions/cache@v2
256 key: ${{ steps.get_keys.outputs.ccache }}-${{ github.ref }}
258 ${{ steps.get_keys.outputs.ccache }}-refs/heads/main
259 - name: Prepare working directory
263 echo CC=ccache ${{ matrix.config.compiler }} >> ~/env
264 echo DEF_LIB=${{ matrix.config.library }} >> ~/env
265 - name: Load the cached image
267 docker load -i ~/.image/${{ matrix.config.image }}.tar
268 docker run -d -i --rm --name dpdk \
269 --mount type=bind,src=$HOME/.ccache,dst=/root/.ccache \
270 --mount type=bind,src=$(pwd),dst=/root/dpdk \
276 run: docker exec -i dpdk dnf update -y || true
277 - name: Install packages
278 run: docker exec -i dpdk dnf install -y ccache numactl-devel
279 python3-setuptools python3-wheel python3-pip python3-pyelftools
280 ninja-build libatomic libbpf-devel libfdt-devel libpcap-devel
281 openssl-devel rdma-core-devel zlib-devel ${{ matrix.config.compiler }}
283 run: docker exec -i dpdk .ci/linux-setup.sh
285 run: docker exec -i dpdk .ci/linux-build.sh
287 run: docker kill dpdk
288 - name: Upload logs on failure
290 uses: actions/upload-artifact@v2
292 name: ${{ steps.get_keys.outputs.logs }}
295 build/meson-logs/meson-log.txt