Skip to content

Commit

Permalink
build: add CMake preset for development (#252)
Browse files Browse the repository at this point in the history
* build: add `CMakePresets.json` file

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

* ci: use CMake presets in workflows

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>

---------

Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
  • Loading branch information
threeal authored Oct 16, 2024
1 parent 2a27fdc commit fe4dfe3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ jobs:
uses: actions/checkout@v4.2.1

- name: Configure Project
uses: threeal/cmake-action@v2.0.0
with:
run-build: false
run: cmake --preset default

- name: Install Project
run: cmake --install build --prefix install
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@ jobs:
uses: actions/checkout@v4.2.1

- name: Configure Project
uses: threeal/cmake-action@v2.0.0
with:
options: ASSERTION_ENABLE_TESTS=ON
run-build: false
run: cmake --preset development

- name: Test Project
uses: threeal/ctest-action@v1.1.0
with:
verbose: true
run: ctest --preset development
32 changes: 32 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 21
},
"configurePresets": [
{
"name": "default",
"binaryDir": "${sourceDir}/build"
},
{
"name": "development",
"inherits": ["default"],
"cacheVariables": {
"ASSERTION_ENABLE_TESTS": "ON"
}
}
],
"testPresets": [
{
"name": "development",
"configurePreset": "development",
"output": {
"verbosity": "verbose"
},
"execution": {
"noTestsAction": "error"
}
}
]
}

0 comments on commit fe4dfe3

Please sign in to comment.