generated from Life4gal/CMakeTemplateProject
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (94 loc) · 3.47 KB
/
main.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Main CI
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
CTEST_OUTPUT_ON_FAILURE: 1
CPM_SOURCE_CACHE: ${{ github.workspace }}/cpm_modules
jobs:
linux:
strategy:
fail-fast: false
matrix:
toolset: [ CLANG, GCC ]
build_type: [ Debug, Release ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3
- uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
- name: Create Build Environment
run: cmake -E make_directory out/build/linux-x64-${{matrix.build_type}}-${{matrix.toolset}}/
- name: Configure
working-directory: out/build/linux-x64-${{matrix.build_type}}-${{matrix.toolset}}/
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.build_type}} --preset linux-x64-${{matrix.build_type}}-${{matrix.toolset}}
- name: Build
working-directory: out/build/linux-x64-${{matrix.build_type}}-${{matrix.toolset}}/
run: cmake --build . --config ${{matrix.build_type}}
- name: Test
working-directory: out/build/linux-x64-${{matrix.build_type}}-${{matrix.toolset}}/
run: ctest -C ${{matrix.build_type}} --output-on-failure
macos:
strategy:
fail-fast: false
matrix:
xcode:
- '13'
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: ${{matrix.xcode}}
- name: Create Build Environment
run: cmake -E make_directory build
- name: Configure
working-directory: build/
run: cmake $GITHUB_WORKSPACE
- name: Build
working-directory: build/
run: cmake --build .
- name: Test
working-directory: build/
run: ctest --output-on-failure
windows:
strategy:
fail-fast: false
matrix:
toolset: [ CLANG, MSVC ]
build_type: [ Debug, Release ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Install ninja-build tool
uses: seanmiddleditch/gha-setup-ninja@v3
- name: Enable Developer Command Prompt
uses: ilammy/[email protected]
- uses: actions/cache@v3
with:
path: "**/cpm_modules"
key: ${{ github.workflow }}-cpm-modules-${{ hashFiles('**/CMakeLists.txt', '**/*.cmake') }}
- name: Create Build Environment
run: cmake -E make_directory out/build/win-x64-${{matrix.build_type}}-${{matrix.toolset}}/
- name: Configure
shell: bash
working-directory: out/build/win-x64-${{matrix.build_type}}-${{matrix.toolset}}/
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=${{matrix.build_type}} --preset win-x64-${{matrix.build_type}}-${{matrix.toolset}}
- name: Build
working-directory: out/build/win-x64-${{matrix.build_type}}-${{matrix.toolset}}/
run: cmake --build . --config ${{matrix.build_type}}
- name: Test
working-directory: out/build/win-x64-${{matrix.build_type}}-${{matrix.toolset}}/
run: ctest -C ${{matrix.build_type}} --output-on-failure