forked from raceintospace/raceintospace
-
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.
Github workflow for building on Windows
- Loading branch information
Showing
4 changed files
with
124 additions
and
0 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,57 @@ | ||
# Copyright (c) 2019-2020-2021-2022 Luca Cappa | ||
# Released under the term specified in file LICENSE.txt | ||
# SPDX short identifier: MIT | ||
# | ||
# Source: https://raw.githubusercontent.com/lukka/CppBuildTasks-Validation/v10/.github/workflows/hosted-ninja-vcpkg_submod-autocache.yml | ||
name: Build on Windows with VCPKG | ||
on: [push, workflow_dispatch] | ||
|
||
jobs: | ||
job: | ||
name: ${{ matrix.os }}-${{ github.workflow }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [windows-latest] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
# This is useful to avoid https://github.com/microsoft/vcpkg/issues/25349 | ||
# which is caused by missing Git history on the vcpkg submodule which ports | ||
# try to access. | ||
fetch-depth: 0 | ||
|
||
- uses: lukka/get-cmake@latest | ||
- name: List $RUNNER_WORKSPACE before vcpkg is setup | ||
run: find $RUNNER_WORKSPACE | ||
shell: bash | ||
|
||
- name: Restore vcpkg executable and data files from GH Action cache, or setup vcpkg from scratch if there is a cache-miss | ||
uses: lukka/run-vcpkg@v11 | ||
id: runvcpkg | ||
with: | ||
# This one is not needed, as it is the default value anyway. | ||
# vcpkgDirectory: '${{ github.workspace }}/vcpkg' | ||
vcpkgJsonGlob: 'vcpkg.json' | ||
# Leverage the cache containing vcpkg executable and data files (e.g. port files). | ||
doNotCache: false | ||
|
||
- name: List $RUNNER_WORKSPACE before build | ||
run: find $RUNNER_WORKSPACE | ||
shell: bash | ||
- name: Prints output of run-vcpkg's action. | ||
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' " | ||
- name: Run CMake+vcpkg+Ninja | ||
uses: lukka/run-cmake@v10 | ||
id: runcmake | ||
with: | ||
cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' | ||
configurePreset: 'windows-release' | ||
buildPreset: 'windows-release' | ||
#packagePreset: 'windows-release' | ||
- name: List $RUNNER_WORKSPACE after build | ||
run: find $RUNNER_WORKSPACE | ||
shell: bash |
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,3 @@ | ||
[submodule "vcpkg"] | ||
path = vcpkg | ||
url = https://github.com/microsoft/vcpkg.git |
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,63 @@ | ||
{ | ||
"version": 3, | ||
"cmakeMinimumRequired": { | ||
"major": 3, | ||
"minor": 21, | ||
"patch": 0 | ||
}, | ||
"configurePresets": [ | ||
{ | ||
"name": "debug", | ||
"displayName": "Debug build settings", | ||
"binaryDir": "${sourceDir}/build/debug", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Debug" | ||
} | ||
}, | ||
{ | ||
"name": "release", | ||
"displayName": "Release build settings", | ||
"binaryDir": "${sourceDir}/build/release", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Release" | ||
} | ||
}, | ||
{ | ||
"name": "windows", | ||
"displayName": "Windows build vcpkg & ninja settings", | ||
"generator": "Ninja", | ||
"cacheVariables": { | ||
"CMAKE_TOOLCHAIN_FILE": "./vcpkg/scripts/buildsystems/vcpkg.cmake", | ||
"VCPKG_TARGET_TRIPLET": "x64-windows" | ||
} | ||
}, | ||
{ | ||
"name": "windows-release", | ||
"displayName": "Windows release build", | ||
"inherits": [ | ||
"release", | ||
"windows" | ||
] | ||
}, | ||
{ | ||
"name": "windows-debug", | ||
"displayName": "Windows debug build", | ||
"inherits": [ | ||
"debug", | ||
"windows" | ||
] | ||
} | ||
], | ||
"buildPresets": [ | ||
{ | ||
"name": "windows-release", | ||
"displayName": "Windows release build", | ||
"configurePreset": "windows-release" | ||
}, | ||
{ | ||
"name": "windows-debug", | ||
"displayName": "Windows debug build", | ||
"configurePreset": "windows-debug" | ||
} | ||
] | ||
} |