1name: build 2 3on: 4 push: 5 schedule: 6 - cron: '0 0 * * 1' 7 8defaults: 9 run: 10 shell: bash --noprofile --norc -exo pipefail {0} 11 12jobs: 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: v21.05 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: Update APT cache 91 run: sudo apt update || true 92 - name: Install packages 93 run: sudo apt install -y ccache libnuma-dev python3-setuptools 94 python3-wheel python3-pip python3-pyelftools ninja-build libbsd-dev 95 libpcap-dev libibverbs-dev libcrypto++-dev libfdt-dev libjansson-dev 96 libarchive-dev 97 - name: Install libabigail build dependencies if no cache is available 98 if: env.ABI_CHECKS == 'true' && steps.libabigail-cache.outputs.cache-hit != 'true' 99 run: sudo apt install -y autoconf automake libtool pkg-config libxml2-dev 100 libdw-dev 101 - name: Install i386 cross compiling packages 102 if: env.BUILD_32BIT == 'true' 103 run: sudo apt install -y gcc-multilib 104 - name: Install aarch64 cross compiling packages 105 if: env.AARCH64 == 'true' 106 run: sudo apt install -y gcc-aarch64-linux-gnu libc6-dev-arm64-cross 107 pkg-config-aarch64-linux-gnu 108 - name: Install test tools packages 109 if: env.AARCH64 != 'true' || env.RUN_TESTS == 'true' 110 run: sudo apt install -y gdb 111 - name: Install doc generation packages 112 if: env.BUILD_DOCS == 'true' 113 run: sudo apt install -y doxygen graphviz python3-sphinx 114 python3-sphinx-rtd-theme 115 - name: Run setup 116 run: | 117 .ci/linux-setup.sh 118 # Workaround on $HOME permissions as EAL checks them for plugin loading 119 chmod o-w $HOME 120 - name: Build and test 121 run: .ci/linux-build.sh 122 - name: Upload logs on failure 123 if: failure() 124 uses: actions/upload-artifact@v2 125 with: 126 name: meson-logs-${{ join(matrix.config.*, '-') }} 127 path: | 128 build/meson-logs/testlog.txt 129 build/.ninja_log 130 build/meson-logs/meson-log.txt 131 build/gdb.log 132