Skip to content

Commit 6504368

Browse files
committed
ci preset template
1 parent 971b374 commit 6504368

File tree

2 files changed

+39
-49
lines changed

2 files changed

+39
-49
lines changed

.github/workflows/ci_cmake.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,29 @@ jobs:
1919
with:
2020
python-version: '3.x'
2121

22-
- run: cmake --preset=make
22+
- run: cmake --preset make
2323
- run: cmake --build build --parallel
24-
- run: ctest --parallel 2 --output-on-failure
25-
working-directory: build
24+
- run: ctest --preset default
2625

2726

2827
macos:
28+
env:
29+
CC: gcc-10
30+
FC: gfortran-10
2931
runs-on: macos-latest
3032
steps:
3133
- uses: actions/checkout@v2
3234

33-
- run: cmake --preset=makegcc10
35+
- run: cmake --preset make
3436
- run: cmake --build build --parallel
35-
- run: ctest --parallel 2 --output-on-failure
36-
working-directory: build
37+
- run: ctest --preset default
3738

3839

3940
windows:
4041
runs-on: windows-latest
4142
steps:
4243
- uses: actions/checkout@v2
4344

44-
- run: cmake --preset=makewin
45+
- run: cmake --preset makewin
4546
- run: cmake --build build --parallel
46-
- run: ctest --parallel 2 --output-on-failure
47-
working-directory: build
47+
- run: ctest --preset default

CMakePresets.json

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,31 @@
11
{
2-
"version": 1,
3-
"cmakeMinimumRequired": {
4-
"major": 3,
5-
"minor": 19,
6-
"patch": 0
2+
"version": 2,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 20,
6+
"patch": 0
77
},
88

99
"configurePresets": [
1010
{
11-
"name": "_default", "hidden": true,
11+
"name": "default",
1212
"binaryDir": "${sourceDir}/build",
13+
"generator": "Ninja",
1314
"cacheVariables": {"CMAKE_BUILD_TYPE": "Release"}
1415
},
1516
{
16-
"name": "ninja", "inherits": "_default",
17-
"displayName": "build with Ninja",
18-
"description": "Ninja is faster and more reliable than Make",
19-
"generator": "Ninja"
20-
},
21-
{
22-
"name": "gcc10", "inherits": "ninja",
23-
"displayName": "GCC-10",
24-
"description": "specify GCC version -- helpful for MacOS Homebrew to avoid Clang /usr/bin/gcc",
25-
"environment": {
26-
"CC": "gcc-10",
27-
"CXX": "g++-10",
28-
"FC": "gfortran-10"
29-
}
30-
},
31-
{
32-
"name": "make", "inherits": "_default",
33-
"displayName": "build with GNU Make: Linux/MacOS",
34-
"description": "build with GNU Make on Linux/MacOS",
17+
"name": "make", "inherits": "default",
18+
"displayName": "build with GNU Make",
3519
"generator": "Unix Makefiles"
3620
},
3721
{
38-
"name": "makegcc10", "inherits": ["make", "gcc10"],
39-
"displayName": "build with GNU Make and GCC",
40-
"description": "build with GNU Make and GCC -- useful for MacOS"
41-
},
42-
{
43-
"name": "makewin", "inherits": "_default",
22+
"name": "makewin", "inherits": "default",
4423
"displayName": "build with GNU Make: Windows",
45-
"description": "build with GNU Make on Windows",
4624
"generator": "MinGW Makefiles"
4725
},
4826
{
49-
"name": "intel", "inherits": "ninja",
27+
"name": "intel", "inherits": "default",
5028
"displayName": "Intel Classic compiler: Linux/MacOS",
51-
"description": "build with Intel Classic on Linux/MacOS",
5229
"environment": {
5330
"CC": "icc",
5431
"CXX": "icpc",
@@ -60,7 +37,6 @@
6037
{
6138
"name": "intelwin", "inherits": "intel",
6239
"displayName": "Intel Classic compiler: Windows",
63-
"description": "build with Intel Classic on Windows",
6440
"environment": {
6541
"CC": "icl",
6642
"CXX": "icl"
@@ -69,16 +45,30 @@
6945
{
7046
"name": "intelnext", "inherits": "intel",
7147
"displayName": "Intel oneAPI LLVM",
72-
"description": "build with Intel oneAPI NextGen LLVM",
7348
"environment": {
7449
"CC": "icx",
7550
"CXX": "icx",
7651
"FC": "ifx"
7752
}
7853
}
79-
54+
],
55+
"buildPresets": [
56+
{
57+
"name": "default",
58+
"configurePreset": "default"
59+
}
60+
],
61+
"testPresets": [
62+
{
63+
"name": "default",
64+
"configurePreset": "default",
65+
"output": {
66+
"outputOnFailure": true,
67+
"verbosity": "default"
68+
},
69+
"execution": {
70+
"noTestsAction": "error",
71+
"stopOnFailure": false}
72+
}
8073
]
81-
82-
83-
8474
}

0 commit comments

Comments
 (0)