-
Notifications
You must be signed in to change notification settings - Fork 9
87 lines (76 loc) · 2.38 KB
/
build-and-test-via-cmake.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
name: build
on:
push:
pull_request:
schedule:
- cron: '3 14 1 * *' # <https://crontab.guru/#3_14_1_*_*> - "Once a month"
workflow_dispatch:
jobs:
clang-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: DoozyX/[email protected]
with:
source: '.'
exclude: './lib'
clangFormatVersion: 9
build:
env:
BUILD_PATH: ${{ github.workspace }}/${{ matrix.relative_build_dir_path }}build_space
strategy:
fail-fast: false
matrix:
include:
- job-name: windows-latest
os: windows-latest
generator: '"Visual Studio 17 2022"'
relative_build_dir_path: ''
- job-name: windows-latest (clangcl)
os: windows-latest
generator: '"Visual Studio 17 2022" -T "clangcl"'
relative_build_dir_path: ''
- job-name: ubuntu-latest
os: ubuntu-latest
generator: '"Unix Makefiles"'
relative_build_dir_path: ''
- job-name: ubuntu-18.04-latest
os: ubuntu-latest
generator: '"Ninja"'
relative_build_dir_path: '../'
- job-name: macOS-latest
os: macOS-latest
generator: '"Unix Makefiles"'
relative_build_dir_path: ''
- job-name: macOS-latest-unity
os: macOS-latest
generator: '"Unix Makefiles" -DCMAKE_UNITY_BUILD=yes'
relative_build_dir_path: ''
- job-name: macOS-latest-ninja
os: macOS-latest
generator: '"Ninja"'
relative_build_dir_path: '../'
- job-name: macOS-latest-ninja-unity
os: macOS-latest
generator: '"Ninja" -DCMAKE_UNITY_BUILD=yes'
relative_build_dir_path: ''
runs-on: ${{ matrix.os }}
name: ${{ matrix.job-name }}
steps:
- uses: actions/checkout@master
- uses: seanmiddleditch/gha-setup-ninja@v3
if: contains(matrix.generator, 'Ninja')
- name: configure
run: |
mkdir ${{ env.BUILD_PATH }}
cd ${{ env.BUILD_PATH }}
cmake --version
cmake -G ${{ matrix.generator }} ${{ github.workspace }} -DCMAKE_BUILD_TYPE=Debug
- name: build
run: |
cd ${{ env.BUILD_PATH }}
cmake --build . --parallel 4
- name: test
run: |
cd ${{ env.BUILD_PATH }}
ctest --verbose --output-on-failure -C Debug