-
Notifications
You must be signed in to change notification settings - Fork 6
100 lines (85 loc) · 2.72 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Build TulipHook
on:
workflow_dispatch:
push:
branches:
- '**' # every branch
- '!no-build-**' # unless marked as no-build
jobs:
build:
strategy:
fail-fast: false
matrix:
config:
- name: 'Windows'
id: win
os: windows-latest
build_tests: true
extra_flags: '-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug'
out_paths: './build/src/TulipHook.lib'
- name: 'macOS'
id: mac
os: macos-latest
build_tests: true
extra_flags: "-DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_BUILD_TYPE=Debug"
out_paths: './build/src/libTulipHook.a'
- name: 'Android Armv7'
id: android-armv7
os: ubuntu-latest
build_tests: false
extra_flags: "-DCMAKE_BUILD_TYPE=Debug -DCMAKE_TOOLCHAIN_FILE=$NDK_PATH/build/cmake/android.toolchain.cmake -DANDROID_ABI=armeabi-v7a -DANDROID_PLATFORM=android-25 -DANDROID_ARM_NEON=ON"
out_paths: './build/src/libTulipHook.a'
name: Build and Test ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1.12.1
with:
arch: x86
if: matrix.config.id == 'win'
- name: Setup NDK
id: setup-ndk
uses: nttld/setup-ndk@v1
with:
ndk-version: r26b
local-cache: true
if: matrix.config.id == 'android-armv7'
- name: Update ccache and Ninja
shell: bash
run: |
choco install ccache
choco install ninja
ccache --version
echo "=============="
ninja --version
if: matrix.config.id == 'win'
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: v1-${{ matrix.config.os }}-${{ github.ref }}
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3
if: matrix.config.id != 'win'
- name: Configure
shell: bash
run: cmake -G Ninja -B ./build ${{ matrix.config.extra_flags }}
env:
NDK_PATH: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Build
shell: bash
run: |
cmake --build ./build --parallel
mkdir ./out
cp ${{ matrix.config.out_paths }} ./out
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: output-${{ matrix.config.os }}
path: ${{ github.workspace }}/out
- name: Test
run: ctest --test-dir ./build/test --output-on-failure
if: matrix.config.build_tests == true