ci: enable v21 ABI checks
[dpdk.git] / .github / workflows / build.yml
1 name: build
2
3 on:
4   push:
5   schedule:
6     - cron: '0 0 * * 1'
7
8 defaults:
9   run:
10     shell: bash --noprofile --norc -exo pipefail {0}
11
12 jobs:
13   build:
14     name: ${{ join(matrix.config.*, '-') }}
15     runs-on: ${{ matrix.config.os }}
16     env:
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       REF_GIT_TAG: v20.11
25       RUN_TESTS: ${{ contains(matrix.config.checks, 'tests') }}
26
27     strategy:
28       fail-fast: false
29       matrix:
30         config:
31           - os: ubuntu-18.04
32             compiler: gcc
33             library: static
34           - os: ubuntu-18.04
35             compiler: gcc
36             library: shared
37             checks: abi+doc+tests
38           - os: ubuntu-18.04
39             compiler: clang
40             library: static
41           - os: ubuntu-18.04
42             compiler: clang
43             library: shared
44             checks: doc+tests
45           - os: ubuntu-18.04
46             compiler: gcc
47             library: static
48             cross: i386
49           - os: ubuntu-18.04
50             compiler: gcc
51             library: static
52             cross: aarch64
53           - os: ubuntu-18.04
54             compiler: gcc
55             library: shared
56             cross: aarch64
57
58     steps:
59     - name: Checkout sources
60       uses: actions/checkout@v2
61     - name: Generate cache keys
62       id: get_ref_keys
63       run: |
64         echo -n '::set-output name=ccache::'
65         echo 'ccache-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-'$(date -u +%Y-w%W)
66         echo -n '::set-output name=libabigail::'
67         echo 'libabigail-${{ matrix.config.os }}'
68         echo -n '::set-output name=abi::'
69         echo 'abi-${{ matrix.config.os }}-${{ matrix.config.compiler }}-${{ matrix.config.cross }}-${{ env.LIBABIGAIL_VERSION }}-${{ env.REF_GIT_TAG }}'
70     - name: Retrieve ccache cache
71       uses: actions/cache@v2
72       with:
73         path: ~/.ccache
74         key: ${{ steps.get_ref_keys.outputs.ccache }}-${{ github.ref }}
75         restore-keys: |
76           ${{ steps.get_ref_keys.outputs.ccache }}-refs/heads/main
77     - name: Retrieve libabigail cache
78       id: libabigail-cache
79       uses: actions/cache@v2
80       if: env.ABI_CHECKS == 'true'
81       with:
82         path: libabigail
83         key: ${{ steps.get_ref_keys.outputs.libabigail }}
84     - name: Retrieve ABI reference cache
85       uses: actions/cache@v2
86       if: env.ABI_CHECKS == 'true'
87       with:
88         path: reference
89         key: ${{ steps.get_ref_keys.outputs.abi }}
90     - name: Install packages
91       run: sudo apt install -y ccache libnuma-dev python3-setuptools
92         python3-wheel python3-pip ninja-build libbsd-dev libpcap-dev
93         libibverbs-dev libcrypto++-dev libfdt-dev libjansson-dev
94     - name: Install libabigail build dependencies if no cache is available
95       if: env.ABI_CHECKS == 'true' && steps.libabigail-cache.outputs.cache-hit != 'true'
96       run: sudo apt install -y autoconf automake libtool pkg-config libxml2-dev
97           libdw-dev
98     - name: Install i386 cross compiling packages
99       if: env.BUILD_32BIT == 'true'
100       run: sudo apt install -y gcc-multilib
101     - name: Install aarch64 cross compiling packages
102       if: env.AARCH64 == 'true'
103       run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross
104         pkg-config-aarch64-linux-gnu
105     - name: Install doc generation packages
106       if: env.BUILD_DOCS == 'true'
107       run: sudo apt install -y doxygen graphviz python3-sphinx
108         python3-sphinx-rtd-theme
109     - name: Run setup
110       run: |
111         .ci/linux-setup.sh
112         # Workaround on $HOME permissions as EAL checks them for plugin loading
113         chmod o-w $HOME
114     - name: Build and test
115       run: .ci/linux-build.sh
116     - name: Upload logs on failure
117       if: failure()
118       uses: actions/upload-artifact@v2
119       with:
120         name: meson-logs-${{ join(matrix.config.*, '-') }}
121         path: |
122           build/meson-logs/testlog.txt
123           build/.ninja_log
124           build/meson-logs/meson-log.txt