91 lines (85 loc) · 3.53 KB
/
hosted-cmakesettingsjson-cache-submod_vcpkg.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Copyright (c) 2019-2020-2021 Luca Cappa
# Released under the term specified in file LICENSE.txt
# SPDX short identifier: MIT
name: hosted-cmakesettingsjson-submod_vcpkg-autocache
on: [push]
jobs:
job:
name: ${{ matrix.os }}-hosted-cmakesettingsjson-cache-submod_vcpkg
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: windows-latest
triplet: x64-windows
configuration: 'x64.*'
- os: ubuntu-latest
triplet: x64-linux
configuration: 'Linux.*'
- os: macos-latest
triplet: x64-osx
configuration: 'Linux.*'
steps:
- uses: actions/checkout@v1
with:
submodules: true
- uses: lukka/get-cmake@latest
- name: Set vcpkg's response file path used as part of cache's key.
uses: lukka/set-shell-env@master
with:
VCPKGRESPONSEFILE: ${{ github.workspace }}/cmakesettingsjson/vcpkg_${{ matrix.triplet }}.txt
filter: VCPKGRESPONSEFILE
- name: dir
run: find $RUNNER_WORKSPACE
shell: bash
- name: Restore artifacts, run vcpkg, build and cache artifacts
uses: lukka/run-vcpkg@fixes
id: runvcpkg
with:
vcpkgArguments: '@${{ env.VCPKGRESPONSEFILE }}'
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
# Ensure the cache key changes any time the content of the response file changes.
appendedCacheKey: ${{ hashFiles( env.VCPKGRESPONSEFILE ) }}
- name: Prints output of run-vcpkg's task
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_TRIPLET_OUT }}' "
- name: 'CMake+Makefiles'
uses: lukka/run-cmake@main
if: contains( matrix.os, 'windows') == false
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/cmakesettingsjson/CMakeLists.txt'
useVcpkgToolchainFile: true
buildDirectory: '${{ runner.workspace }}/b//unixmakefiles'
cmakeAppendedArgs: '-G"Unix Makefiles"'
- name: 'CMake+XCode CMakeListsTxtAdvanced'
uses: lukka/run-cmake@main
if: contains( matrix.os, 'macos')
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/cmakesettingsjson/CMakeLists.txt'
useVcpkgToolchainFile: true
buildDirectory: '${{ runner.workspace }}/b/xcode'
cmakeAppendedArgs: '-GXcode'
- name: 'CMake+Ninja CMakeListsTxtAdvanced'
uses: lukka/run-cmake@main
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/cmakesettingsjson/CMakeLists.txt'
useVcpkgToolchainFile: true
buildDirectory: '${{ runner.workspace }}/ninja'
cmakeAppendedArgs: '-GNinja'
- name: 'CMakeSettings.json'
uses: lukka/run-cmake@main
with:
cmakeListsOrSettingsJson: CMakeSettingsJson
cmakeSettingsJsonPath: '${{ github.workspace }}/cmakesettingsjson/CMakeSettings.json'
useVcpkgToolchainFile: true
configurationRegexFilter: '${{ matrix.configuration }}'
- name: dir
run: find ${{ runner.workspace }}
if: "!contains( matrix.os, 'windows')"
- name: dir
run: gci -recurse ${{ runner.workspace }}
if: contains( matrix.os, 'windows')