This repository has been archived by the owner on Sep 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 24
156 lines (152 loc) · 4.86 KB
/
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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: CMake
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
name: ${{ matrix.settings.name }} ${{ matrix.configuration }}
runs-on: ${{ matrix.settings.os }}
strategy:
matrix:
configuration: ["Release", "Debug"]
settings:
- {
name: "Ubuntu GCC-8",
os: ubuntu-20.04,
compiler:
{ type: GCC, version: 10, cc: "gcc-8", cxx: "g++-8", std: 17 },
lib: "libstdc++11",
}
- {
name: "Ubuntu GCC-9",
os: ubuntu-20.04,
compiler:
{ type: GCC, version: 10, cc: "gcc-9", cxx: "g++-9", std: 17 },
lib: "libstdc++11",
}
- {
name: "Ubuntu GCC-10",
os: ubuntu-20.04,
compiler:
{
type: GCC,
version: 10,
cc: "gcc-10",
cxx: "g++-10",
std: 20,
},
lib: "libstdc++11",
}
- {
name: "Ubuntu GCC-11",
os: ubuntu-20.04,
compiler: { type: GCC, version: 11, cc: "gcc-11", cxx: "g++-11" },
lib: "libstdc++11",
}
- {
name: "Ubuntu Clang-10 + libc++",
os: ubuntu-20.04,
compiler:
{
type: CLANG,
version: 10,
cc: "clang-10",
cxx: "clang++-10",
std: 20,
},
lib: "libc++",
}
- {
name: "Ubuntu Clang-11 + libc++",
os: ubuntu-20.04,
compiler:
{
type: CLANG,
version: 11,
cc: "clang-11",
cxx: "clang++-11",
std: 20,
},
lib: "libc++",
}
- {
name: "Ubuntu Clang-12 + libc++",
os: ubuntu-20.04,
compiler:
{
type: CLANG,
version: 12,
cc: "clang-12",
cxx: "clang++-12",
std: 20,
},
lib: "libc++",
}
- {
name: "Ubuntu Clang-13 + libc++",
os: ubuntu-20.04,
compiler:
{
type: CLANG,
version: 13,
cc: "clang-13",
cxx: "clang++-13",
std: 20,
},
lib: "libc++",
}
- {
name: "Visual Studio 2019",
os: windows-latest,
compiler: { type: VISUAL, version: 16, cc: "cl", cxx: "cl" },
}
- {
name: "MacOS Apple Clang 13",
os: macos-11,
compiler:
{
type: APPLE_CLANG,
version: "13.0",
cc: "clang",
cxx: "clang++",
std: 20,
},
}
steps:
- uses: actions/checkout@v2
- name: Add msbuild to PATH
if: matrix.settings.os == 'windows-latest'
uses: microsoft/[email protected]
with:
vs-version: "16.5"
- name: Install Latest GCC
if: matrix.settings.compiler.type == 'GCC'
uses: egor-tensin/setup-gcc@v1
with:
version: ${{ matrix.settings.compiler.version }}
platform: x64
- name: Install Clang
if: matrix.settings.compiler.type == 'CLANG'
uses: egor-tensin/setup-clang@v1
with:
version: ${{ matrix.settings.compiler.version }}
platform: x64
- name: Select Xcode 13.0
if: matrix.config.compiler.type == 'APPLE_CLANG' && matrix.config.compiler.version == '13.0'
shell: bash
run: |
sudo xcode-select -s "/Applications/Xcode_13.0.app"
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.configuration }}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{ matrix.configuration }}