-
Notifications
You must be signed in to change notification settings - Fork 15
77 lines (69 loc) · 3.06 KB
/
hosted-ninja-vcpkg-install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# Copyright (c) 2019-2020-2021-2022-2023 Luca Cappa
# Released under the term specified in file LICENSE.txt
# SPDX short identifier: MIT
#
# The peculiarity of this workflow is that runs `vcpkg install` at `run-vcpkg`,
# rather than with `run-cmake.
# Also, it does not assume that vcpkg is a submodule of this repository.
#
# The workflow does the following:
# - Download and setup vcpkg (which is stored NOT in a Git submodule), then run
# `vcpkg install` to install the packages described in vcpkg.json manifest file.
# - Note: at this point, all the vcpkg dependencies specified in vcpkg.json are installed,
# and it is possible to run anything that is needed to build the C++ application as.
# long the paths to headers and libraries are correctly set.
#
# - _Warning:_ in this sample, CMake is going to be used to build the application,
# but anything else could be used. This means that vcpkg will be run again and
# it will quickly realize that all dependencies are already installed.
# In short: *it is not needed to run vcpkg* in the step before if you build with CMake,
# since CMake will run it for you already!
# Look to (hosted-ninja-vcpkg_submod.yml)[./hosted-ninja-vcpkg_submod.yml] sample.
#
# - Finally, it runs CMake with CMakePreset.json and vcpkg's toolchain file to build
# the C++ sources with Ninja.
name: hosted-ninja-vcpkg-install-cacheoff
on: [push, workflow_dispatch]
jobs:
job:
name: ${{ matrix.os }}-${{ github.workflow }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- os: ubuntu-latest
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
- os: macos-latest
vcpkgCommitId: 'a42af01b72c28a8e1d7b48107b33e4f286a55ef6'
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: lukka/get-cmake@latest
- name: List $RUNNER_WORKSPACE before build
run: find $RUNNER_WORKSPACE
shell: bash
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
vcpkgGitCommitId: '${{ matrix.vcpkgCommitId }}'
# Run vcpkg with the command specified by the `runVcpkgFormatString` input.
runVcpkgInstall: true
vcpkgJsonGlob: '**/cmakepresets/vcpkg.json'
- 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 with Ninja
uses: lukka/run-cmake@v10
with:
cmakeListsTxtPath: '${{ github.workspace }}/cmakepresets/CMakeLists.txt'
configurePreset: 'ninja-multi-vcpkg'
buildPreset: 'ninja-multi-vcpkg'
- name: List $RUNNER_WORKSPACE after build
run: find $RUNNER_WORKSPACE
shell: bash