• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Build using CMake
2on: [push]
3concurrency:
4  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
5  cancel-in-progress: true
6jobs:
7  cmake-linux-local:
8    runs-on: ubuntu-latest
9    timeout-minutes: 40
10    steps:
11      - uses: actions/checkout@v2
12      - name: Update apt
13        run: sudo apt update
14      - name: Install ninja
15        run: sudo apt install ninja-build
16      - name: Configure and build
17        run: scripts/build-local.sh
18        working-directory: ${{ github.workspace }}
19  cmake-linux-aarch64:
20    runs-on: ubuntu-22.04
21    timeout-minutes: 70
22    steps:
23      - uses: actions/checkout@v2
24      - name: Update apt
25        run: sudo apt update
26      - name: Install ninja
27        run: sudo apt install ninja-build
28      - name: Install aarch64 cross-toolchain
29        run: sudo apt install crossbuild-essential-arm64
30      - name: Install qemu-aarch64
31        run: sudo apt install qemu-user
32      - name: Configure and build
33        run: scripts/build-linux-aarch64.sh -DCMAKE_BUILD_TYPE=Release
34        working-directory: ${{ github.workspace }}
35      - name: Run tests
36        run: ctest --output-on-failure --parallel $(nproc)
37        working-directory: ${{ github.workspace }}/build/linux/aarch64
38  cmake-linux-armhf:
39    runs-on: ubuntu-22.04
40    timeout-minutes: 60
41    steps:
42      - uses: actions/checkout@v2
43      - name: Update apt
44        run: sudo apt update
45      - name: Install ninja
46        run: sudo apt install ninja-build
47      - name: Install armhf cross-toolchain
48        run: sudo apt install crossbuild-essential-armhf
49      - name: Install qemu-arm
50        run: sudo apt install qemu-user
51      - name: Configure and build
52        run: scripts/build-linux-armhf.sh -DCMAKE_BUILD_TYPE=Release
53        working-directory: ${{ github.workspace }}
54      - name: Run tests
55        run: ctest --output-on-failure --parallel $(nproc)
56        working-directory: ${{ github.workspace }}/build/linux/armhf
57  cmake-linux-riscv64:
58    runs-on: ubuntu-22.04
59    timeout-minutes: 60
60    steps:
61      - uses: actions/checkout@v2
62      - name: Update apt
63        run: sudo apt update
64      - name: Install ninja
65        run: sudo apt install ninja-build
66      - name: Install riscv64 cross-toolchain
67        run: sudo apt install crossbuild-essential-riscv64
68      - name: Install qemu-riscv64
69        run: sudo apt install qemu-user
70      - name: Configure and build
71        run: scripts/build-linux-riscv64.sh -DCMAKE_BUILD_TYPE=Release
72        working-directory: ${{ github.workspace }}
73      - name: Run tests
74        run: ctest --output-on-failure --parallel $(nproc)
75        working-directory: ${{ github.workspace }}/build/linux/riscv64
76  cmake-windows:
77    runs-on: windows-latest
78    timeout-minutes: 40
79    steps:
80      - uses: actions/checkout@v2
81      - name: Install ninja
82        run: choco install ninja
83      - name: Configure and build
84        run: scripts/build-windows.sh
85        shell: bash  # Specify bash so we can reuse the build script on Windows (runs on Git bash)
86        working-directory: ${{ github.workspace }}
87  cmake-android:
88    strategy:
89      matrix:
90        script: [build-android-arm64.sh, build-android-armv7.sh, build-android-x86.sh]
91    runs-on: ubuntu-latest
92    timeout-minutes: 40
93    steps:
94      - uses: actions/checkout@v2
95      - name: Update apt
96        run: sudo apt update
97      - name: Install ninja
98        run: sudo apt install ninja-build
99      - name: Setup Android NDK
100        id: setup-ndk
101        uses: nttld/setup-ndk@v1.0.6
102        with:
103          ndk-version: r23b
104          add-to-path: false
105      - name: Configure and build
106        run: scripts/${{ matrix.script }}
107        working-directory: ${{ github.workspace }}
108        env:
109          ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
110