115 lines (111 loc) · 5.13 KB
/
hosted-advanced-setup-vcpkg-win_c_drive.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# Copyright (c) 2020-2021 Luca Cappa
# Released under the term specified in file LICENSE.txt
# SPDX short identifier: MIT
name: hosted-advanced-setup-vcpkg-autocache-cdrive-win
on: [push]
jobs:
job:
name: ${{ matrix.os }}-hosted-advanced
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
include:
- os: windows-latest
triplet: x64-windows
vcpkgCommitId: '30124253eecff36bc90f73341edbfb4f845e2a1e'
vcpkgPackages: 'sqlite3'
configuration: 'x64.*'
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: Set vcpkg's response file path used as part of cache's key.
uses: lukka/set-shell-env@master
with:
VCPKGRESPONSEFILE: ${{ github.workspace }}/cmakeliststxt/vcpkg_${{ matrix.triplet }}.txt
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
VCPKG_DEST_WIN: C:\qbt_tools\vcpkg
filter: ^VCPKG.*
- name: Restore artifacts, or setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@fixes
id: runvcpkg
with:
setupOnly: true
vcpkgDirectory: '${{ env.VCPKG_DEST_WIN }}'
vcpkgGitCommitId: '${{ matrix.vcpkgCommitId}}'
# Ensure the cache key changes any time the content of the response file changes.
appendedCacheKey: ${{ hashFiles( env.VCPKGRESPONSEFILE ) }}
- run: |
$VCPKG_ROOT/vcpkg install @$VCPKGRESPONSEFILE --clean-after-build
shell: bash
name: Run vcpkg in a inline script in this workflow.
- 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: Prints output of ANDROID_SDK_ROOT and ANDROID_HOME env var
run: echo "ANDROID_SDK_ROOT=$ANDROID_SDK_ROOT ANDROID_HOME=$ANDROID_HOME"
shell: bash
- name: Run CMake with Ninja Multi-Config
uses: lukka/run-cmake@main
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/cmakeliststxt/CMakeLists.txt'
useVcpkgToolchainFile: true
buildDirectory: '${{ runner.workspace }}/b/ninjaMultiConfig'
cmakeAppendedArgs: '"-GNinja Multi-Config" -DVCPKG_TARGET_TRIPLET=${{ env.VCPKG_DEFAULT_TRIPLET }} '
buildWithCMake: true
- name: Run CMake+EnvVar (Un*x)
if: "!contains( matrix.os, 'windows')"
uses: lukka/run-cmake@main
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/cmakeliststxt/CMakeLists.txt'
useVcpkgToolchainFile: true
buildDirectory: '${{ runner.workspace }}/b/envvar_ninja'
cmakeAppendedArgs: '-GNinja -DVCPKG_TARGET_TRIPLET=${{ env.VCPKG_DEFAULT_TRIPLET }} -DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk-bundle/build/cmake/android.toolchain.cmake'
buildWithCMake: false
- name: Run CMake+EnvVar (Win)
if: "contains( matrix.os, 'windows')"
uses: lukka/run-cmake@main
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/cmakeliststxt/CMakeLists.txt'
useVcpkgToolchainFile: true
buildDirectory: '${{ runner.workspace }}/b/envvar_ninja'
cmakeAppendedArgs: '-GNinja -DVCPKG_TARGET_TRIPLET=${{ env.VCPKG_DEFAULT_TRIPLET }} -DCMAKE_TOOLCHAIN_FILE=%ANDROID_NDK_HOME%/build/cmake/android.toolchain.cmake'
buildWithCMake: false
- name: Run CMake+Ninja
uses: lukka/run-cmake@main
id: runcmake
with:
cmakeListsTxtPath: '${{ github.workspace }}/cmakeliststxt/CMakeLists.txt'
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
useVcpkgToolchainFile: true
buildWithCMakeArgs: '-- -v'
buildDirectory: '${{ runner.workspace }}/b/ninja/'
cmakeAppendedArgs: '-GNinja -DVCPKG_TARGET_TRIPLET=${{ env.VCPKG_DEFAULT_TRIPLET }}'
- name: Run CMake+VS
uses: lukka/run-cmake@main
if: contains( matrix.os, 'windows')
with:
cmakeListsOrSettingsJson: CMakeListsTxtAdvanced
cmakeListsTxtPath: '${{ github.workspace }}/cmakeliststxt/CMakeLists.txt'
useVcpkgToolchainFile: true
buildDirectory: '${{ runner.workspace }}/b/vs16'
cmakeAppendedArgs: '"-GVisual Studio 16 2019" -Ax64 -DVCPKG_TARGET_TRIPLET=${{ env.VCPKG_DEFAULT_TRIPLET }} '
- name: 'Run CMake with CMakeSettings.json'
uses: lukka/run-cmake@main
with:
cmakeListsOrSettingsJson: CMakeSettingsJson
cmakeSettingsJsonPath: '${{ github.workspace }}/cmakesettingsjson/CMakeSettings.json'
useVcpkgToolchainFile: true
configurationRegexFilter: ${{ matrix.configuration }}
cmakeAppendedArgs: '-DVCPKG_TARGET_TRIPLET=${{ env.VCPKG_DEFAULT_TRIPLET }}'