Skip to content

Commit

Permalink
Add simple CMake presets
Browse files Browse the repository at this point in the history
Removed workflows

Removed working directory from CI scripts

Working directory for CMake steps are taken care of using
CMakePreset file

Adjusted CMakePreset to match CI steps

Revert CTest preset

Switched to Ninja build from multi config

Reverted Windows CI file
  • Loading branch information
SeanAlling-DojoFive committed Jan 20, 2024
1 parent 6fa2523 commit 9174652
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 33 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,17 @@ jobs:
- name: Configure
run: |
export CXX=$(echo ${{ matrix.compiler }} | sed -E 's/^(g|clang)(cc)?/\1++/')
cmake -G Ninja -S . -B build
cmake --preset default --fresh
- name: Build
working-directory: build
run: ninja srecord-executables
run: cmake --build --preset srecord-executables

- name: Smoke test
working-directory: build
run: ninja srecord-executables-version
run: cmake --build --preset srecord-executables-version

- name: Build test prerequisites
working-directory: build
run: ninja prepare-test

run: cmake --build --preset prepare-test

- name: Test
working-directory: build
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,16 @@ jobs:
- uses: actions/checkout@v3

- name: Configure
run: cmake -G Ninja -S . -B build
run: cmake --preset default --fresh

- name: Build
working-directory: build
run: ninja srecord-executables
run: cmake --build --preset srecord-executables

- name: Smoke test
working-directory: build
run: ninja srecord-executables-version
run: cmake --build --preset srecord-executables-version

- name: Build test prerequisites
working-directory: build
run: ninja prepare-test
run: cmake --build --preset prepare-test

- name: Test
working-directory: build
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,16 @@ jobs:
- uses: actions/checkout@v3

- name: Configure
run: cmake -G Ninja -S . -B build
run: cmake --preset default --fresh

- name: Build
working-directory: build
run: ninja srecord-executables
run: cmake --build --preset srecord-executables

- name: Smoke test
working-directory: build
run: ninja srecord-executables-version
run: cmake --build --preset srecord-executables-version

- name: Build test prerequisites
working-directory: build
run: ninja prepare-test
run: cmake --build --preset prepare-test

- name: Test
working-directory: build
Expand Down
20 changes: 8 additions & 12 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,23 @@ jobs:
-Wextra
SRecord_CMake_Flags: >-
-D CMAKE_EXPORT_COMPILE_COMMANDS=ON
run: cmake -G Ninja -S . -B build ${SRecord_CMake_Flags}
run: cmake --preset default --fresh ${SRecord_CMake_Flags}
# cSpell:enable

- name: Build
working-directory: build
run: ninja -k 0 srecord-executables

- name: Smoke test
working-directory: build
run: ninja srecord-executables-version
run: cmake --build --preset srecord-executables-version

- name: Build test prerequisites
working-directory: build
run: ninja prepare-test
run: cmake --build --preset prepare-test

- name: Test
working-directory: build
run: ctest --output-on-failure --output-junit ctest.junit.xml


- name: clang-tidy
if: always()
run: run-clang-tidy-14 -p build -header-filter=.*
Expand Down Expand Up @@ -92,25 +90,23 @@ jobs:
-Wno-implicit-fallthrough
SRecord_CMake_Flags: >-
-D CMAKE_EXPORT_COMPILE_COMMANDS=ON
run: cmake -G Ninja -S . -B build ${SRecord_CMake_Flags}
run: cmake --preset default --fresh ${SRecord_CMake_Flags}

Check failure on line 93 in .github/workflows/qa.yml

View workflow job for this annotation

GitHub Actions / MegaLinter

93:14 [colons] too many spaces after colon
# cSpell:enable

- name: Build
working-directory: build
run: ninja -k 0 srecord-executables

- name: Smoke test
working-directory: build
run: ninja srecord-executables-version
run: cmake --build srecord-executables-version

- name: Build test prerequisites
working-directory: build
run: ninja prepare-test
run: cmake --build prepare-test

- name: Test
working-directory: build
run: ctest --output-on-failure --output-junit ctest.junit.xml


docs:
name: Documentation
runs-on: ubuntu-22.04
Expand Down
76 changes: 76 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"version": 6,
"cmakeMinimumRequired": {
"major": 3,
"minor": 25,
"patch": 0
},
"configurePresets": [
{
"name": "cmake-pedantic",
"hidden": true,
"warnings": {
"dev": false,
"uninitialized": false,
"systemVars": false
},
"errors": {
"deprecated": true
}
},
{
"name": "ci-build",
"binaryDir": "${sourceDir}/build",
"hidden": true
},
{
"name": "ninja",
"generator": "Ninja",
"hidden": true
},
{
"name": "default",
"displayName": "Basic configuration",
"inherits": ["ci-build", "cmake-pedantic", "ninja"]
}
],
"buildPresets": [
{
"name": "default-config-preset",
"hidden": true,
"configurePreset": "default"
},
{
"name": "clean",
"displayName": "Debug build",
"targets" : "clean",
"inherits": ["default-config-preset"]
},
{
"name": "srecord-executables",
"displayName": "Debug build",
"targets" : "srecord-executables",
"inherits": ["default-config-preset"]
},
{
"name": "srecord-executables-version",
"displayName": "Debug build",
"inherits": ["default-config-preset"],
"targets" : "srecord-executables-version"
},
{
"name": "prepare-test",
"displayName": "Debug build",
"inherits": ["default-config-preset"],
"targets" : "prepare-test"
}
],
"testPresets": [
{
"name": "test",
"configurePreset": "default",
"output": {"outputOnFailure": true, "outputJUnitFile": "ctest.junit.xml"}

}
]
}

0 comments on commit 9174652

Please sign in to comment.