-
Notifications
You must be signed in to change notification settings - Fork 9
186 lines (163 loc) · 6.63 KB
/
win.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: Build win64
on:
push:
paths-ignore:
- '.github/workflows/android.yml'
- '.github/workflows/ios.yml'
- '.github/workflows/linux.yml'
- '.github/workflows/mac.yml'
- 'vcpkg-overlay/triplets/arm-android.yml'
- 'vcpkg-overlay/triplets/arm64-android.yml'
- 'vcpkg-overlay/triplets/arm64-ios.yml'
- 'vcpkg-overlay/triplets/arm64-osx.yml'
- 'vcpkg-overlay/triplets/x64-linux.yml'
- 'vcpkg-overlay/triplets/x64-osx.yml'
- 'scripts/**'
- 'LICENSE'
- 'README.md'
concurrency:
group: ci-${{github.ref}}-windows
cancel-in-progress: true
jobs:
win64_build:
if: ( github.repository == 'MerginMaps/input-sdk' )
runs-on: windows-2019
env: # update README for devs if you modify these env. variables
QT_VERSION: '6.5.3' # use scripts/update_qt_version.bash to change
TRIPLET: "x64-windows"
VS_VERSION: "2019"
CMAKE_GENERATOR: "Visual Studio 16 2019" # see https://github.com/actions/runner-images/blob/main/images/win/Windows2019-Readme.md
CMAKE_ARCH: "x64"
QT_ARCH: "win64_msvc2019_64"
VCPKG_ROOT: "C:/vcpkg-root" # Looks like there is more space on C: than on D: drive (~14GB)
steps:
- uses: actions/checkout@v3
with:
path: input-sdk
- name: Prepare vars
id: vars
shell: bash
run: |
WORKSPACE_DIR=$(cygpath -m "${{ github.workspace }}")
echo "::set-output name=WORKSPACE_DIR::$WORKSPACE_DIR"
echo "WORKSPACE_DIR: $WORKSPACE_DIR"
- uses: jurplel/install-qt-action@v3
with:
version: ${{ env.QT_VERSION }}
setup-python: 'false'
target: desktop
arch: ${{ env.QT_ARCH }}
dir: ${{ github.workspace }}
modules: 'qtsensors qtconnectivity qt5compat qtmultimedia qtpositioning qtshadertools'
cache: true
cache-key-prefix: ${{ runner.os }}-QtCache-v1-${{ env.QT_VERSION }}-win
- name: Get vcpkg
shell: bash
run: |
mkdir -p "${{ env.VCPKG_ROOT }}"
cd "${{ env.VCPKG_ROOT }}"
git init
git remote add origin https://github.com/microsoft/vcpkg.git
git pull origin master
VCPKG_TAG=`cat ${{ steps.vars.outputs.WORKSPACE_DIR }}/input-sdk/VCPKG_BASELINE`
echo "using VCPKG_TAG ${VCPKG_TAG}"
git checkout ${VCPKG_TAG}
- name: Install vcpkg
shell: cmd
run: |
CALL "C:\vcpkg-root\bootstrap-vcpkg.bat"
- name: Setup compiler
shell: cmd
run: |
CALL "C:\Program Files (x86)\Microsoft Visual Studio\${{ env.VS_VERSION }}\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=${{ env.CMAKE_ARCH }}
- name: Build Deps
shell: pwsh
run: |
$ErrorActionPreference = 'continue'
function exec
{
param ( [ScriptBlock] $ScriptBlock )
& $ScriptBlock 2>&1 | ForEach-Object -Process { "$_" }
if ($LastExitCode -ne 0) { exit $LastExitCode }
}
cd $env:GITHUB_WORKSPACE
mkdir ${{ github.workspace }}\build -ea 0
$env:PATH="$env:VCPKG_ROOT;$env:PATH"
exec {
cmake -B ${{ github.workspace }}\build `
-S ${{ github.workspace }}\input-sdk `
-DCMAKE_TOOLCHAIN_FILE:PATH="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" `
-G "${{ env.CMAKE_GENERATOR }}" `
-A ${{ env.CMAKE_ARCH }} `
-DVCPKG_TARGET_TRIPLET=${{ env.TRIPLET }} `
-DVCPKG_OVERLAY_TRIPLETS:PATH="${{ steps.vars.outputs.WORKSPACE_DIR }}/input-sdk/vcpkg-overlay/triplets" `
-DVCPKG_OVERLAY_PORTS="${{ steps.vars.outputs.WORKSPACE_DIR }}/input-sdk/vcpkg-overlay/ports"
}
- name: Upload build logs on deps failure
uses: actions/upload-artifact@v3
if: failure()
with:
name: build-logs-${{ env.TRIPLET }}
path: |
${{ env.VCPKG_ROOT }}/buildtrees/**/*.log
- name: Build Test App
shell: pwsh
run: |
$ErrorActionPreference = 'continue'
function exec
{
param ( [ScriptBlock] $ScriptBlock )
& $ScriptBlock 2>&1 | ForEach-Object -Process { "$_" }
if ($LastExitCode -ne 0) { exit $LastExitCode }
}
$env:PATH="$env:VCPKG_ROOT;$env:PATH"
cd $env:GITHUB_WORKSPACE
exec { cmake --build ${{ github.workspace }}\build --config Release --verbose }
- name: Run SDK Tests
shell: pwsh
run: |
$ErrorActionPreference = 'continue'
function exec
{
param ( [ScriptBlock] $ScriptBlock )
& $ScriptBlock 2>&1 | ForEach-Object -Process { "$_" }
if ($LastExitCode -ne 0) { exit $LastExitCode }
}
exec { ${{ github.workspace }}\build\Release\merginmapsinputsdk.exe }
- name: Get TimeStamp
id: time
uses: nanzm/[email protected]
with:
timeZone: 8
format: 'YYYYMMDD'
- name: Create SDK data folder
shell: bash
run: |
mkdir -p ${{ steps.vars.outputs.WORKSPACE_DIR }}/sdk
cp -R ${{ steps.vars.outputs.WORKSPACE_DIR }}/build/vcpkg_installed/${{ env.TRIPLET }}/* ${{ steps.vars.outputs.WORKSPACE_DIR }}/sdk/
rm -rf ${{ steps.vars.outputs.WORKSPACE_DIR }}/sdk/etc
rm -rf ${{ steps.vars.outputs.WORKSPACE_DIR }}/sdk/mkspecs
rm -rf ${{ steps.vars.outputs.WORKSPACE_DIR }}/sdk/share
rm -rf ${{ steps.vars.outputs.WORKSPACE_DIR }}/sdk/tools
SDK_TAR=mergin-maps-input-sdk-qt-${{ env.QT_VERSION }}-${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }}.zip
echo "SDK_TAR=${SDK_TAR}" >> $GITHUB_ENV
- name: Create ZIP package
uses: thedoctor0/[email protected]
with:
type: 'zip'
directory: sdk/
filename: ${{ steps.vars.outputs.WORKSPACE_DIR }}/${{ env.SDK_TAR }}
- name: Upload Sdk in Artifacts
uses: actions/upload-artifact@v3
with:
name: sdk-${{ env.TRIPLET }}
path: ${{ steps.vars.outputs.WORKSPACE_DIR }}/${{ env.SDK_TAR }}
if-no-files-found: error
- name: Create Release
if: ${{ github.ref == 'refs/heads/master' }}
uses: ncipollo/release-action@v1
with:
tag: ${{ env.TRIPLET }}-${{ steps.time.outputs.time }}-${{ github.run_number }}
allowUpdates: true
artifacts: ${{ env.SDK_TAR }}
token: ${{ secrets.GITHUB_TOKEN }}