• 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          cflags: -D__USE_MINGW_ANSI_STDIO
40        - build: macos
41          cc: clang
42          os: macos-latest
43    steps:
44      - uses: actions/checkout@v3
45      - name: Install Android NDK
46        run: |
47          if [ ${{matrix.build}} = android ]; then \
48              wget --quiet https://dl.google.com/android/repository/android-ndk-r24-linux.zip; \
49              unzip -q android-ndk-r24-linux.zip;  \
50          fi
51      - name: Install Ubuntu packages
52        run: |
53          sudo apt-get -q update
54          case "${{matrix.host}}" in                                        \
55            x86_64-w64-mingw32)                                             \
56              sudo apt-get -q install -y binutils-mingw-w64 gcc-mingw-w64;; \
57            powerpc64-linux-gnu)                                            \
58              sudo apt-get -q install -y binutils-powerpc64-linux-gnu       \
59              gcc-powerpc64-linux-gnu;;                                     \
60          esac
61      - name: Build
62        run: |
63          echo "HOST=${{matrix.host}}"
64          NDK=$PWD/android-ndk-r24/toolchains/llvm/prebuilt/linux-x86_64/bin
65          export PATH="$NDK:$PATH"
66          ./autogen.sh
67          ./configure --host=${{matrix.host}} \
68              CC=${{ matrix.host && format('{0}-{1}', matrix.host, matrix.cc) || matrix.cc }} \
69              CFLAGS="-Wall -Wextra -Werror -Wno-sign-compare -Wno-unused-function -Wno-unused-parameter ${{matrix.cflags}}"
70          make -j$(nproc)
71