Skip to content

Commit 4a9f1be

Browse files
authored
ci: Use CMakePresets for MacOS CI
Signed-off-by: GitHub <[email protected]>
1 parent a4066eb commit 4a9f1be

File tree

3 files changed

+56
-2
lines changed

3 files changed

+56
-2
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,17 @@ jobs:
5757
shell: bash
5858
run: brew install ninja popt
5959

60-
- name: Configure Build & Test
60+
- name: Configure
61+
shell: bash
62+
run: cmake --preset ci-macos
63+
64+
- name: Build
65+
shell: bash
66+
run: cmake --build --preset ci-macos
67+
68+
- name: Test
6169
shell: bash
62-
run: ./travis.sh macos
70+
run: ctest --preset ci-macos
6371

6472
build-win32:
6573
runs-on: windows-latest

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
/libtool
2424
/ltmain.sh
2525
/missing
26+
/out
2627
/stamp-h1
2728
/test-suite.log
2829
INSTALL

CMakePresets.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"version": 3,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 22,
6+
"patch": 0
7+
},
8+
"configurePresets": [
9+
{
10+
"name": "ci-macos",
11+
"displayName": "Continuous integration for MacOS",
12+
"description": "Sets Ninja generator, build and install directory",
13+
"generator": "Ninja",
14+
"binaryDir": "${sourceDir}/out/build/${presetName}",
15+
"cacheVariables": {
16+
"CMAKE_INSTALL_PREFIX": "${sourceDir}/out/install/${presetName}",
17+
"CMAKE_BUILD_TYPE": "Debug",
18+
"CMAKE_C_FLAGS": "-Wall -Wextra -Wstrict-prototypes -Wno-unused-function -Werror",
19+
"OPENSSL_ROOT_DIR": "/usr/local/opt/[email protected]",
20+
"BUILD_EXAMPLES": "ON",
21+
"BUILD_TESTING": "ON",
22+
"BUILD_TOOLS": "ON"
23+
}
24+
}
25+
],
26+
"buildPresets": [
27+
{
28+
"name": "ci-macos",
29+
"description": "",
30+
"displayName": "",
31+
"configurePreset": "ci-macos",
32+
"targets": [
33+
"install"
34+
]
35+
}
36+
],
37+
"testPresets": [
38+
{
39+
"name": "ci-macos",
40+
"description": "",
41+
"displayName": "",
42+
"configurePreset": "ci-macos"
43+
}
44+
]
45+
}

0 commit comments

Comments
 (0)