-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
76 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# This starter workflow is for a CMake project running on a single platform. There is a different starter workflow if you need cross-platform coverage. | ||
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml | ||
name: CMake on a single platform | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
env: | ||
VCPKG_ROOT: ${{ github.workspace }}/vcpkg | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up CMake | ||
uses: lukka/get-cmake@latest | ||
|
||
- name: Restore from cache and install vcpkg | ||
uses: lukka/run-vcpkg@v11 | ||
with: | ||
vcpkgGitCommitId: 73964f854d0d6424f335e9515b61b3a2dad5e15b | ||
vcpkgJsonGlob: '**/vcpkg.json' | ||
|
||
- name: Run CMake consuming CMakePreset.json and run vcpkg to build packages | ||
uses: lukka/run-cmake@v10 | ||
with: | ||
configurePreset: 'linux-x64' | ||
|
||
- name: Build | ||
# Build your program with the given configuration | ||
run: cmake --build ${{github.workspace}}/build | ||
|
||
- name: Test | ||
working-directory: ${{github.workspace}}/build | ||
run: ctest --output-on-failure |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,37 @@ | ||
{ | ||
"version": 2, | ||
"configurePresets": [ | ||
{ | ||
"name": "default", | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/build", | ||
"cacheVariables": { | ||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" | ||
"version": 3, | ||
"configurePresets": [ | ||
{ | ||
"name": "base", | ||
"hidden": true, | ||
"cacheVariables": { | ||
"CMAKE_TOOLCHAIN_FILE": { | ||
"value": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", | ||
"type": "FILEPATH" | ||
} | ||
}, | ||
"binaryDir": "${sourceDir}/build" | ||
|
||
}, | ||
{ | ||
"name": "macos-arm", | ||
"inherits": "base", | ||
"description": "Preset for ARM macOS", | ||
"generator": "Ninja", | ||
"cacheVariables": { | ||
"CMAKE_SYSTEM_NAME": "Darwin", | ||
"VCPKG_TARGET_TRIPLET": "arm64-osx" | ||
} | ||
] | ||
} | ||
|
||
}, | ||
{ | ||
"name": "linux-x64", | ||
"inherits": "base", | ||
"description": "Preset for x64 Linux", | ||
"generator": "Ninja", | ||
"cacheVariables": { | ||
"CMAKE_SYSTEM_NAME": "Linux", | ||
"VCPKG_TARGET_TRIPLET": "x64-linux" | ||
} | ||
} | ||
] | ||
} |