-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
341 lines (313 loc) · 13 KB
/
.gitlab-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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
# This file is a template, and might need editing before it works on your project.
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
# This is a sample GitLab CI/CD configuration file that should run without any modifications.
# It demonstrates a basic 3 stage CI/CD pipeline. Instead of real tests or scripts,
# it uses echo commands to simulate the pipeline execution.
#
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
#
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
variables:
ASCI_LIBPACK_NAME: "analysissitus-libpack-msvc2019"
ASCI_3RDPARTY_DIR: "$CI_BUILDS_DIR/../$ASCI_LIBPACK_NAME"
ASCI_WORKING_DIR: "$CI_BUILDS_DIR/$CI_PROJECT_NAME"
GIT_CLONE_PATH: "$CI_BUILDS_DIR/$CI_PROJECT_NAME/$CI_PIPELINE_ID"
ASCI_BUILD_DIR: "$CI_BUILDS_DIR/$CI_PROJECT_NAME/$CI_PIPELINE_ID/build"
ASCI_BUILD_POSTFIX: "$CI_PIPELINE_ID"
ASCI_INSTALL_DIR: "$CI_BUILDS_DIR/$CI_PROJECT_NAME/$CI_PIPELINE_ID/install"
ASCI_DEPLOY_DIR: "$CI_BUILDS_DIR/../"
ASCI_URL_3RDPARTY_LIBPACK: "http://analysissitus.org/files/libpacks/$ASCI_LIBPACK_NAME.zip"
ASCI_3RDPARTY_LIBPACK_DIST: "$CI_BUILDS_DIR/../$ASCI_LIBPACK_NAME.zip"
ASCI_CMAKE_LIBPACK_NAME: "cmake-3.23.0-rc5-windows-x86_64"
ASCI_CMAKE_DIR: "$CI_BUILDS_DIR/../$ASCI_CMAKE_LIBPACK_NAME"
ASCI_CMAKE_URL_LIBPACK: "https://github.com/Kitware/CMake/releases/download/v3.23.0-rc5/$ASCI_CMAKE_LIBPACK_NAME.zip"
ASCI_CMAKE_LIBPACK_DIST: "$CI_BUILDS_DIR/../$ASCI_CMAKE_LIBPACK_NAME.zip"
AS_ASI_TEST_DUMPING: "$ASCI_BUILD_DIR/test-dumping/"
AS_ASI_PLUGINS_DIR: "$ASCI_BUILD_DIR/asi-plugins/"
AS_ASI_TEST_DATA: "$CI_BUILDS_DIR/$CI_PROJECT_NAME/$CI_PIPELINE_ID/data/"
AS_ASI_TEST_SCRIPTS: "$GIT_CLONE_PATH/scripts/"
stages:
- init
- configure
- build
- test
- linux
- deploy
- cleanup
init:windows:
stage: init
tags:
- dev-shell
script:
- if ("$ASCI_BUILD_DIR" | Test-Path) {
- Remove-Item $ASCI_BUILD_DIR -Recurse -ErrorAction Ignore }
- mkdir $ASCI_BUILD_DIR -Force
# 3RDPARTY
- if ("$ASCI_3RDPARTY_DIR" | Test-Path) {
- Remove-Item $ASCI_3RDPARTY_DIR -Recurse -ErrorAction Ignore }
- mkdir $ASCI_3RDPARTY_DIR -Force
- if ("$ASCI_3RDPARTY_LIBPACK_DIST" | Test-Path) {
- Remove-Item $ASCI_3RDPARTY_LIBPACK_DIST -Recurse -ErrorAction Ignore }
# CMAKE
- if ("$ASCI_CMAKE_DIR" | Test-Path) {
- Remove-Item $ASCI_CMAKE_DIR -Recurse -ErrorAction Ignore }
- mkdir $ASCI_CMAKE_DIR -Force
- if ("$ASCI_CMAKE_LIBPACK_DIST" | Test-Path) {
- Remove-Item $ASCI_CMAKE_LIBPACK_DIST -Recurse -ErrorAction Ignore }
rules:
- if: $CI_SKIP_PROJECT
when: never
- if: ($CI_PIPELINE_SOURCE != 'push' || $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH) && $CI_PIPELINE_SOURCE != 'merge_request_event' && $CI_PIPELINE_SOURCE != 'schedule'
when: manual
- when: on_success
configure:windows:
variables:
GIT_STRATEGY: none
stage: configure
tags:
- dev-shell
script:
# 3RDPARTY
- if (-not ("$ASCI_3RDPARTY_DIR" | Test-Path)) { mkdir $ASCI_3RDPARTY_DIR -Force }
- Invoke-WebRequest -Uri $ASCI_URL_3RDPARTY_LIBPACK -OutFile $ASCI_3RDPARTY_LIBPACK_DIST
- $ExtractShell = New-Object -ComObject Shell.Application
- $parsedLocDist = [IO.Path]::GetFullPath($ASCI_3RDPARTY_LIBPACK_DIST)
- $Files = $ExtractShell.Namespace($parsedLocDist).Items()
- $parsedLoc3rdParty = [IO.Path]::GetFullPath($ASCI_3RDPARTY_DIR)
- $ExtractShell.NameSpace($parsedLoc3rdParty).CopyHere($Files)
# CMAKE
- if (-not ("$ASCI_CMAKE_DIR" | Test-Path)) { mkdir $ASCI_CMAKE_DIR -Force }
- Invoke-WebRequest -Uri $ASCI_CMAKE_URL_LIBPACK -OutFile $ASCI_CMAKE_LIBPACK_DIST
- $ExtractShellCmake= New-Object -ComObject Shell.Application
- $parsedLocCmakeDist = [IO.Path]::GetFullPath($ASCI_CMAKE_LIBPACK_DIST)
- $CmakeFiles = $ExtractShellCmake.Namespace($parsedLocCmakeDist).Items()
- $parsedLocCmake = [IO.Path]::GetFullPath($ASCI_CMAKE_DIR)
- $ExtractShellCmake.NameSpace($parsedLocCmake).CopyHere($CmakeFiles)
# Configure
- cd $ASCI_BUILD_DIR
- $parsed_ASI_TEST_DUMPING = [IO.Path]::GetFullPath($AS_ASI_TEST_DUMPING)
- $parsed_ASI_TEST_DUMPING = "$($parsed_ASI_TEST_DUMPING.Split("\") -join "/")"
- $parsed_ASI_PLUGINS_DIR = [IO.Path]::GetFullPath($AS_ASI_PLUGINS_DIR)
- $parsed_ASI_PLUGINS_DIR = "$($parsed_ASI_PLUGINS_DIR.Split("\") -join "/")"
- $parsed_ASI_TEST_DATA = [IO.Path]::GetFullPath($AS_ASI_TEST_DATA)
- $parsed_ASI_TEST_DATA = "$($parsed_ASI_TEST_DATA.Split("\") -join "/")"
- $parsed_ASI_TEST_SCRIPTS = [IO.Path]::GetFullPath($AS_ASI_TEST_SCRIPTS)
- $parsed_ASI_TEST_SCRIPTS = "$($parsed_ASI_TEST_SCRIPTS.Split("\") -join "/")"
#
- iex '& "$ASCI_CMAKE_DIR/$ASCI_CMAKE_LIBPACK_NAME/bin/cmake.exe" -G "Visual Studio 16 2019" -A "x64" -DINSTALL_DIR:PATH="$ASCI_INSTALL_DIR" -D3RDPARTY_DIR:PATH="$ASCI_3RDPARTY_DIR" -DUSE_CONSOLE:BOOL="True" -DUSE_FBX_SDK:BOOL="False" -DUSE_INSTANT_MESHES:BOOL="False" -DUSE_MOBIUS:BOOL="False" -DUSE_NETGEN:BOOL="False" -DUSE_RAPIDJSON:BOOL="True" -DUSE_THREADING:BOOL="False" -DDISTRIBUTION_TYPE:STRING="Complete" -DASI_TEST_DUMPING:STRING="$parsed_ASI_TEST_DUMPING" -DASI_PLUGINS_DIR:STRING="$parsed_ASI_PLUGINS_DIR" -DASI_TEST_DATA:STRING="$parsed_ASI_TEST_DATA" -DASI_TEST_SCRIPTS:STRING="$parsed_ASI_TEST_SCRIPTS" $GIT_CLONE_PATH'
- if ($LASTEXITCODE) { throw "Configure error" }
dependencies:
- init:windows
rules:
- if: $CI_SKIP_PROJECT
when: never
- if: ($CI_PIPELINE_SOURCE != 'push' || $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH) && $CI_PIPELINE_SOURCE != 'merge_request_event' && $CI_PIPELINE_SOURCE != 'schedule'
when: on_success
- when: on_success
docker:linux:
variables:
GIT_STRATEGY: none
stage: linux
tags:
- dev-shell
script:
- cd $GIT_CLONE_PATH
- docker build --pull --rm -f "Dockerfile" -t as:latest "." --no-cache
- if ($LASTEXITCODE) { throw "Build error" }
dependencies:
- configure:windows
rules:
- if: $CI_SKIP_PROJECT
when: never
- if: ($CI_PIPELINE_SOURCE != 'push' || $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH) && $CI_PIPELINE_SOURCE != 'merge_request_event' && $CI_PIPELINE_SOURCE != 'schedule'
when: on_success
- when: on_success
build:windows:
variables:
GIT_STRATEGY: none
stage: build
tags:
- dev-shell
script:
- cd $ASCI_BUILD_DIR
- iex '& "$ASCI_CMAKE_DIR/$ASCI_CMAKE_LIBPACK_NAME/bin/cmake.exe" --build . --config Release --target ALL_BUILD'
- if ($LASTEXITCODE) { throw "Build error" }
dependencies:
- configure:windows
rules:
- if: $CI_SKIP_PROJECT
when: never
- if: ($CI_PIPELINE_SOURCE != 'push' || $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH) && $CI_PIPELINE_SOURCE != 'merge_request_event' && $CI_PIPELINE_SOURCE != 'schedule'
when: on_success
- when: on_success
build-debug:windows:
variables:
GIT_STRATEGY: none
stage: build
tags:
- dev-shell
script:
- cd $ASCI_BUILD_DIR
- iex '& "$ASCI_CMAKE_DIR/$ASCI_CMAKE_LIBPACK_NAME/bin/cmake.exe" --build . --config RelWithDebInfo --target ALL_BUILD'
- if ($LASTEXITCODE) { throw "Build error" }
dependencies:
- configure:windows
rules:
- if: $ASCI_USE_COVERAGE == "False"
when: never
- if: $CI_SKIP_PROJECT
when: never
- if: ($CI_PIPELINE_SOURCE != 'push' || $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH) && $CI_PIPELINE_SOURCE != 'merge_request_event' && $CI_PIPELINE_SOURCE != 'schedule'
when: on_success
- when: on_success
install:windows:
variables:
GIT_STRATEGY: none
stage: build
tags:
- dev-shell
extends: .zip:windows
script:
- cd $ASCI_BUILD_DIR
- iex '& "$ASCI_CMAKE_DIR/$ASCI_CMAKE_LIBPACK_NAME/bin/cmake.exe" --build . --config Release --target INSTALL'
- if ($LASTEXITCODE) { throw "Install error" }
dependencies:
- build-debug:windows
- build:windows
# artifacts:
# when: always
# expire_in: 24 hrs
# name: "Binaries-$ASCI_BUILD_POSTFIX"
# paths:
# - "$ASCI_INSTALL_DIR/./"
rules:
- if: $ASCI_NIGHT_BUILD == "False"
when: never
- if: $CI_SKIP_PROJECT
when: never
- if: ($CI_PIPELINE_SOURCE != 'push' || $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH) && $CI_PIPELINE_SOURCE != 'merge_request_event' && $CI_PIPELINE_SOURCE != 'schedule'
when: on_success
- when: on_success
test:windows:
variables:
GIT_STRATEGY: none
stage: test
tags:
- dev-shell
script:
- cd $ASCI_INSTALL_DIR
- $parsed_ASI_TEST_DUMPING = [IO.Path]::GetFullPath($AS_ASI_TEST_DUMPING)
- $parsed_ASI_TEST_DUMPING = "$($parsed_ASI_TEST_DUMPING.Split("\") -join "/")"
- $parsed_ASI_PLUGINS_DIR = [IO.Path]::GetFullPath($AS_ASI_PLUGINS_DIR)
- $parsed_ASI_PLUGINS_DIR = "$($parsed_ASI_PLUGINS_DIR.Split("\") -join "/")"
- $parsed_ASI_TEST_DATA = [IO.Path]::GetFullPath($AS_ASI_TEST_DATA)
- $parsed_ASI_TEST_DATA = "$($parsed_ASI_TEST_DATA.Split("\") -join "/")"
- $parsed_ASI_TEST_SCRIPTS = [IO.Path]::GetFullPath($AS_ASI_TEST_SCRIPTS)
- $parsed_ASI_TEST_SCRIPTS = "$($parsed_ASI_TEST_SCRIPTS.Split("\") -join "/")"
#
- $ASI_TEST_DUMPING=$parsed_ASI_TEST_DUMPING
- $ASI_TEST_DATA=$parsed_ASI_TEST_DATA
- $ASI_TEST_SCRIPTS=$parsed_ASI_TEST_SCRIPTS
- $ASI_TEST_DUMPING
- $ASI_TEST_DATA
- $ASI_TEST_SCRIPTS
#
#- echo $env:ASI_TEST_DATA
- $env:ASI_TEST_DATA="$ASI_TEST_DATA"
- $env:ASI_TEST_DUMPING="$ASI_TEST_DUMPING"
- $env:ASI_TEST_SCRIPTS="$ASI_TEST_SCRIPTS"
#- echo $env:ASI_TEST_DATA
#
- iex '& "$ASCI_INSTALL_DIR/bin/asiTest.exe"'
- if ($LASTEXITCODE) { throw "Testing error" }
dependencies:
- install:windows
# artifacts:
# when: always
# expire_in: 24 hrs
# name: "TestReport-$ASCI_BUILD_POSTFIX"
# paths:
# - "$AS_ASI_TEST_DUMPING/./"
rules:
- if: $CI_SKIP_PROJECT
when: never
- if: ($CI_PIPELINE_SOURCE != 'push' || $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH) && $CI_PIPELINE_SOURCE != 'merge_request_event' && $CI_PIPELINE_SOURCE != 'schedule'
when: on_success
- when: on_success
test-cleanup:windows:
variables:
GIT_STRATEGY: none
stage: test
tags:
- dev-shell
script:
- cd $ASCI_INSTALL_DIR
- $parsed_ASI_TEST_DUMPING = [IO.Path]::GetFullPath($AS_ASI_TEST_DUMPING)
- $parsed_ASI_TEST_DUMPING = "$($parsed_ASI_TEST_DUMPING.Split("\") -join "/")"
- $ASI_TEST_DUMPING=$parsed_ASI_TEST_DUMPING
#
- if ("$ASI_TEST_DUMPING" | Test-Path) { (Remove-Item "$ASI_TEST_DUMPING" -Recurse -ErrorAction Ignore) }
rules:
- if: ($CI_PIPELINE_SOURCE != 'push' || $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH) && $CI_PIPELINE_SOURCE != 'merge_request_event' && $CI_PIPELINE_SOURCE != 'schedule'
when: on_success
- when: always
.zip:windows:
variables:
GIT_STRATEGY: none
stage: deploy
before_script:
- $7zipPath = "$env:ProgramFiles\7-Zip\7z.exe"
- if (-not (Test-Path -Path $7zipPath -PathType Leaf)) { throw "7 zip file '$7zipPath' not found" }
- Set-Alias 7zip $7zipPath
deploy:windows:
variables:
GIT_STRATEGY: none
stage: deploy
tags:
- dev-shell
extends: .zip:windows
script:
- cd $ASCI_BUILD_DIR
- $Data = Get-Date -Format "yyyy-MM-dd"
- if (-not ("$ASCI_DEPLOY_DIR/$Data" | Test-Path)) { mkdir $ASCI_DEPLOY_DIR/$Data -Force }
- iex '& "7zip" a -r -mx=6 AS-$Data.zip $ASCI_INSTALL_DIR/*'
- if ($LASTEXITCODE) { throw "Archiving binaries error" }
- Copy-Item -Path "AS-$Data.zip" -Destination "$ASCI_DEPLOY_DIR/$Data/" -PassThru
- if ($LASTEXITCODE) { throw "Copy error" }
dependencies:
- test:windows
- test-cleanup:windows
- install:windows
- docker:linux
# artifacts:
# when: always
# expire_in: 24 hrs
# name: "DeployBinaries-$ASCI_BUILD_POSTFIX"
# paths:
# - "$ASCI_DEPLOY_DIR/$Data/./"
rules:
- if: $ASCI_NIGHT_BUILD == "False"
when: never
- if: $CI_SKIP_PROJECT
when: never
- if: ($CI_PIPELINE_SOURCE != 'push' || $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH) && $CI_PIPELINE_SOURCE != 'merge_request_event' && $CI_PIPELINE_SOURCE != 'schedule'
when: on_success
- when: on_success
cleanup:windows:
variables:
GIT_STRATEGY: none
stage: cleanup
tags:
- dev-shell
script:
- cd ..
- if ("$GIT_CLONE_PATH.tmp" | Test-Path) { (Remove-Item "$GIT_CLONE_PATH.tmp" -Recurse -ErrorAction Ignore) }
- if ("$GIT_CLONE_PATH" | Test-Path) { (Remove-Item "$GIT_CLONE_PATH" -Recurse -ErrorAction Ignore) }
rules:
- if: ($CI_PIPELINE_SOURCE != 'push' || $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH) && $CI_PIPELINE_SOURCE != 'merge_request_event' && $CI_PIPELINE_SOURCE != 'schedule'
when: on_success
- when: always