• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# See also https://docs.github.com/en/actions/learn-github-actions/expressions
2# See also https://github.com/marketplace/actions/setup-android-ndk
3
4name: CI
5
6on: [push, pull_request]
7
8jobs:
9  build:
10    runs-on: ubuntu-latest
11    strategy:
12      fail-fast: false
13      matrix:
14        build:
15        - android
16        - linux-gcc
17        - linux-clang
18        - linux-x86-gcc
19        - linux-powerpc64-gcc
20        - linux-mingw64-gcc
21        - macos
22        include:
23        - build: android
24          cc: clang
25          host: aarch64-linux-android32
26        - build: linux-gcc
27          cc: gcc
28        - build: linux-clang
29          cc: clang
30        - build: linux-x86-gcc
31          cc: gcc
32          arch: x86
33        - build: linux-powerpc64-gcc
34          cc: gcc
35          host: powerpc64-linux-gnu
36        - build: linux-mingw64-gcc
37          cc: gcc
38          host: x86_64-w64-mingw32
39        - build: macos
40          cc: clang
41          os: macos-latest
42    steps:
43      - uses: actions/checkout@v3
44      - name: Install Android NDK
45        run: |
46          if [ ${{matrix.build}} = android ]; then \
47              wget --quiet https://dl.google.com/android/repository/android-ndk-r24-linux.zip; \
48              unzip -q android-ndk-r24-linux.zip;  \
49          fi
50      - name: Install Ubuntu packages
51        run: |
52          sudo apt-get -q update
53          case "${{matrix.host}}" in                                        \
54            x86_64-w64-mingw32)                                             \
55              sudo apt-get -q install -y binutils-mingw-w64 gcc-mingw-w64;; \
56            powerpc64-linux-gnu)                                            \
57              sudo apt-get -q install -y binutils-powerpc64-linux-gnu       \
58              gcc-powerpc64-linux-gnu;;                                     \
59          esac
60      - name: Build
61        run: |
62          echo "HOST=${{matrix.host}}"
63          NDK=$PWD/android-ndk-r24/toolchains/llvm/prebuilt/linux-x86_64/bin
64          export PATH="$NDK:$PATH"
65          ./autogen.sh
66          ./configure --host=${{matrix.host}} \
67              CC=${{ matrix.host && format('{0}-{1}', matrix.host, matrix.cc) || matrix.cc }} \
68              CFLAGS="-Wall -Wextra -Werror -Wno-sign-compare -Wno-unused-function -Wno-unused-parameter ${{matrix.cflags}}"
69          make -j$(nproc)
70