-
-
Notifications
You must be signed in to change notification settings - Fork 44
162 lines (148 loc) · 6.74 KB
/
Windows-CI.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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
name: Windows-CI
# Controls when the action will run.
on:
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-2019
cmake-generator: VS2019Win64
enable-pie: 1
build-type: Debug
- os: windows-2019
cmake-generator: VS2019Win64
enable-pie: 1
build-type: Release
- os: windows-2019
cmake-generator: VS2019Win64
enable-pie: 0
build-type: Debug
- os: windows-2019
cmake-generator: VS2019Win64
enable-pie: 0
build-type: Release
# - os: windows-2019
# cmake-generator: ninja
# enable-pie: 1
# build-type: Debug
# - os: windows-2019
# cmake-generator: ninja
# enable-pie: 1
# build-type: Release
# - os: windows-2019
# cmake-generator: ninja
# enable-pie: 0
# build-type: Debug
# - os: windows-2019
# cmake-generator: ninja
# enable-pie: 0
# build-type: Release
- os: windows-2022
cmake-generator: VS2022Win64
enable-pie: 1
build-type: Debug
- os: windows-2022
cmake-generator: VS2022Win64
enable-pie: 1
build-type: Release
- os: windows-2022
cmake-generator: VS2022Win64
enable-pie: 0
build-type: Debug
- os: windows-2022
cmake-generator: VS2022Win64
enable-pie: 0
build-type: Release
# - os: windows-2022
# cmake-generator: ninja
# enable-pie: 1
# build-type: Debug
# - os: windows-2022
# cmake-generator: ninja
# enable-pie: 1
# build-type: Release
# - os: windows-2022
# cmake-generator: ninja
# enable-pie: 0
# build-type: Debug
# - os: windows-2022
# cmake-generator: ninja
# enable-pie: 0
# build-type: Release
env:
# Indicates the location of vcpkg
VCPKG_ROOT: '${{ github.workspace }}/v'
# Tells vcpkg where binary packages are stored.
VCPKG_DEFAULT_BINARY_CACHE: '${{ github.workspace }}/vbincache'
## Let's use GitHub Action cache as storage for the vcpkg Binary Caching feature.
#VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
VCPKG_DEFAULT_TRIPLET: x64-windows
VCPKG_DEFAULT_HOST_TRIPLET: x64-windows
PYTHONHOME: '${{ github.workspace }}/v/packages/python3_x64-windows/tools/python3'
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Set env vars needed for vcpkg to leverage the GitHub Action cache as a storage
# for Binary Caching.
- uses: actions/github-script@d7906e4ad0b1822421a7e6a35d5ca353c962f410 #v6.4.1
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 #v3.5.3
- name: "Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'"
run: mkdir -p $VCPKG_DEFAULT_BINARY_CACHE
shell: bash
- name: install-cmake
uses: lukka/get-cmake@359fbae4b163fa01633e6de228fa7f2a31ab1fc7 #v3.26.1
with:
cmakeVersion: 3.26.1
ninjaVersion: 1.11.1
# # Restore vcpkg from the GitHub Action cache service. Note that packages are restored by vcpkg's binary caching
# # when it is being run afterward by CMake.
# - name: restore-vcpkg
# uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 #v3.3.1
# with:
# # The first path is the location of vcpkg: it contains the vcpkg executable and data files, as long as the
# # built package archives (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE env var.
# # The other paths starting with '!' are exclusions: they contain temporary files generated during the build of the installed packages.
# path: |
# ${{ env.VCPKG_ROOT }}
# !${{ env.VCPKG_ROOT }}/buildtrees
# !${{ env.VCPKG_ROOT }}/packages
# !${{ env.VCPKG_ROOT }}/downloads
# !${{ env.VCPKG_ROOT }}/installed
# # The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used.
# key: |
# ${{ hashFiles( '.git/modules/vcpkg/HEAD' )}}
- name: install-vcpkg
#if: steps.cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/stephengtuggy/vcpkg-local.git ${{ env.VCPKG_ROOT }}
${{ env.VCPKG_ROOT }}\bootstrap-vcpkg.bat -disableMetrics
- name: run-build-script
working-directory: ${{ github.workspace }}
run: .\script\build.ps1 -Generator ${{ matrix.cmake-generator }} -EnablePIE ${{ matrix.enable-pie }} -BuildType ${{ matrix.build-type }}
- name: Test
working-directory: ${{ github.workspace }}
env:
GTEST_OUTPUT: xml
GTEST_COLOR: 1
run: .\script\test.ps1 -Generator ${{ matrix.cmake-generator }} -EnablePIE ${{ matrix.enable-pie }} -BuildType ${{ matrix.build-type }}
- name: Upload test results
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce #v3.1.2
if: failure()
with:
name: test_results_xml
path: ${{ github.workspace }}/**/test-results/**/*.xml