• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1name: Build using CMake
2on:
3  pull_request:
4  push:
5    branches:
6      - main
7
8permissions:
9  contents: read
10
11concurrency:
12  group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
13  cancel-in-progress: true
14jobs:
15  cmake-linux-local:
16    runs-on: ubuntu-latest
17    timeout-minutes: 40
18    steps:
19      - uses: actions/checkout@v2
20      - name: Update apt
21        run: sudo apt update
22      - name: Install ninja
23        run: sudo apt install ninja-build
24      - name: Configure and build
25        run: scripts/local-build.sh
26        working-directory: ${{ github.workspace }}
27  cmake-darwin:
28    runs-on: macos-latest
29    timeout-minutes: 40
30    steps:
31      - uses: actions/checkout@v2
32      - name: Install ninja
33        run: brew install ninja
34      - name: Configure and build
35        run: scripts/local-build.sh
36        working-directory: ${{ github.workspace }}
37  cmake-windows:
38    runs-on: windows-latest
39    timeout-minutes: 40
40    steps:
41      - uses: actions/checkout@v2
42      - name: Install ninja
43        run: choco install ninja
44      - name: Configure and build
45        run: scripts/local-build.sh
46        shell: bash  # Specify bash so we can reuse the build script on Windows (runs on Git bash)
47        working-directory: ${{ github.workspace }}
48  cmake-uwp:
49    runs-on: windows-latest
50    timeout-minutes: 40
51    steps:
52      - uses: actions/checkout@v2
53      - name: 'x64-uwp(Debug)'
54        uses: lukka/run-cmake@v10
55        with:
56          configurePreset: 'x64-uwp'
57          buildPreset: 'x64-uwp-dbg'
58      - name: 'x64-uwp(Release)'
59        uses: lukka/run-cmake@v10
60        with:
61          configurePreset: 'x64-uwp'
62          buildPreset: 'x64-uwp-rel'
63      - name: 'arm64-uwp(Debug)'
64        uses: lukka/run-cmake@v10
65        with:
66          configurePreset: 'arm64-uwp'
67          buildPreset: 'arm64-uwp-dbg'
68      - name: 'arm64-uwp(Release)'
69        uses: lukka/run-cmake@v10
70        with:
71          configurePreset: 'arm64-uwp'
72          buildPreset: 'arm64-uwp-rel'
73  cmake-android:
74    strategy:
75      matrix:
76        script: [android-arm64-build.sh, android-armv7-build.sh, android-riscv64-build.sh, android-x86-build.sh]
77    runs-on: ubuntu-latest
78    timeout-minutes: 40
79    steps:
80      - uses: actions/checkout@v2
81      - name: Update apt
82        run: sudo apt update
83      - name: Install ninja
84        run: sudo apt install ninja-build
85      - name: Setup Android NDK
86        id: setup-ndk
87        uses: nttld/setup-ndk@v1.0.6
88        with:
89          ndk-version: r27
90          add-to-path: false
91      - name: Configure and build
92        run: scripts/${{ matrix.script }}
93        working-directory: ${{ github.workspace }}
94        env:
95          ANDROID_NDK: ${{ steps.setup-ndk.outputs.ndk-path }}
96  cmake-linux-qemu:
97    runs-on: ubuntu-22.04
98    timeout-minutes: 40
99    strategy:
100      matrix:
101        build_props:
102          - [
103              "cmake-linux-riscv64",
104              "riscv64/ubuntu:22.04"
105          ]
106
107    name: ${{ matrix.build_props[0] }}
108    steps:
109      - uses: actions/checkout@v2
110      - name: Setup QEMU
111        uses: docker/setup-qemu-action@v3.0.0
112      - name: Build cpuinfo in ${{ matrix.build_props[1] }}
113        run: |
114          docker run -i -v $(pwd):/cpuinfo ${{ matrix.build_props[1] }} /bin/bash -c "
115          apt update &&
116          apt install -y cmake git gcc g++ &&
117          cd /cpuinfo &&
118          scripts/local-build.sh"
119