63 lines (59 loc) · 2.45 KB
/
hosted-advanced-setup-vcpkg-manifest.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
# Copyright (c) 2020-2021 Luca Cappa
# Released under the term specified in file LICENSE.txt
# SPDX short identifier: MIT
name: hosted-advanced-setup-vcpkg-with-manifest-autocache
on: [push]
jobs:
job:
name: ${{ matrix.os }}-hosted-advanced-setup-vcpkg-with-manifest-autocache
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
triplet: x64-windows
vcpkgCommitId: '30124253eecff36bc90f73341edbfb4f845e2a1e'
- os: ubuntu-latest
triplet: x64-linux
vcpkgCommitId: '30124253eecff36bc90f73341edbfb4f845e2a1e'
- os: macos-latest
triplet: x64-osx
vcpkgCommitId: '30124253eecff36bc90f73341edbfb4f845e2a1e'
env:
buildDir: '${{ github.workspace }}/b/vcpkg_submod_manifest'
steps:
- uses: actions/checkout@v1
with:
submodules: true
- uses: lukka/get-cmake@latest
- name: dir
run: find $RUNNER_TEMP
shell: bash
- name: dir
run: find $RUNNER_WORKSPACE
shell: bash
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@fixes
id: runvcpkg
with:
setupOnly: true
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
vcpkgGitCommitId: '${{ matrix.vcpkgCommitId}}'
# Ensure the cache key changes any time the content of the manifest file changes.
appendedCacheKey: ${{ hashFiles( '**/vcpkg_manifest/vcpkg.json' ) }}
vcpkgTriplet: ${{ matrix.triplet }}
# Ensure the vcpkg artifacts are cached, they are generated in the 'CMAKE_BINARY_DIR/vcpkg_installed'.
additionalCachedPaths: ${{ env.buildDir }}
- name: Prints output of run-vcpkg's action
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_TRIPLET_OUT }}'"
- name: Run CMake with vcpkg.json manifest
uses: lukka/run-cmake@main
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/vcpkg_manifest/CMakeLists.txt'
useVcpkgToolchainFile: true
buildDirectory: '${{ env.buildDir }}'
cmakeAppendedArgs: '"-GNinja Multi-Config" -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet}} '
buildWithCMake: true