forked from microsoft/Azure-Kinect-Sensor-SDK
-
Notifications
You must be signed in to change notification settings - Fork 7
/
azure-pipelines.yml
892 lines (785 loc) · 32 KB
/
azure-pipelines.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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
name: K4A-SDK-$(SourceBranchName)-$(Date:yyyyMMdd)-$(Rev:rrr)
schedules:
- cron: "*/30 08-13 * * *"
displayName: 'Daily Builds starting at 8:00AM UTC (12:00AM PST) every 30 min, last build 13:30AM (5:30AM PST)'
branches:
include:
- master
- develop
always: true
variables:
- name: 'skipComponentGovernaceDetection'
value: true
- name: 'linux_firmware_version'
value: '1.6.110079014'
- name: 'windows_firmware_version'
value: '1.6.110079014'
- name: 'NuGetPackageVersion'
value: '1.4.1-alpha.0'
- name: 'OpenCVPath'
value: 'C:\OpenCV\Build\x64\vc15\'
trigger:
batch: false
branches:
include:
- master
- develop
- release/*
- hotfix/*
- feature/*
jobs:
- job: WindowsK4ABuildTest
displayName: Win
strategy:
maxParallel: 100
matrix:
VS2017_x64-msvc_debug_ninja:
CMakeArch: 'amd64'
BuildGenerator: 'Ninja'
CMakeConfiguration: 'debug'
MSBuildPlatform: 'x64'
MSBuildConfiguration: 'Debug'
vmImage: 'vs2017-win2016'
UsesOpenCV: 'TRUE'
VS2017_x64-msvc_rel_ninja:
CMakeArch: 'amd64'
BuildGenerator: 'Ninja'
CMakeConfiguration: 'relwithdebinfo'
MSBuildPlatform: 'x64'
MSBuildConfiguration: 'Release'
vmImage: 'vs2017-win2016'
UsesOpenCV: 'TRUE'
VS2017_x64-msvc_debug_msbuild:
CMakeArch: 'amd64'
BuildGenerator: 'Visual Studio 15 2017 Win64'
CMakeConfiguration: 'debug'
MSBuildPlatform: 'x64'
MSBuildConfiguration: 'Debug'
vmImage: 'vs2017-win2016'
UsesOpenCV: 'TRUE'
VS2017_x64-msvc_rel_msbuild:
CMakeArch: 'amd64'
BuildGenerator: 'Visual Studio 15 2017 Win64'
CMakeConfiguration: 'relwithdebinfo'
MSBuildPlatform: 'x64'
MSBuildConfiguration: 'Release'
vmImage: 'vs2017-win2016'
UsesOpenCV: 'TRUE'
VS2017_x86-msvc_debug_ninja:
CMakeArch: 'x86'
BuildGenerator: 'Ninja'
CMakeConfiguration: 'debug'
MSBuildPlatform: 'x86'
MSBuildConfiguration: 'Debug'
vmImage: 'vs2017-win2016'
UsesOpenCV: 'FALSE'
VS2017_x86-msvc_rel_ninja:
CMakeArch: 'x86'
BuildGenerator: 'Ninja'
CMakeConfiguration: 'relwithdebinfo'
MSBuildPlatform: 'x86'
MSBuildConfiguration: 'Release'
vmImage: 'vs2017-win2016'
UsesOpenCV: 'FALSE'
VS2017_x86-msvc_debug_msbuild:
CMakeArch: 'x86'
BuildGenerator: 'Visual Studio 15 2017'
CMakeConfiguration: 'debug'
MSBuildPlatform: 'x86'
MSBuildConfiguration: 'Debug'
vmImage: 'vs2017-win2016'
UsesOpenCV: 'FALSE'
VS2017_x86-msvc_rel_msbuild:
CMakeArch: 'x86'
BuildGenerator: 'Visual Studio 15 2017'
CMakeConfiguration: 'relwithdebinfo'
MSBuildPlatform: 'x86'
MSBuildConfiguration: 'Release'
vmImage: 'vs2017-win2016'
UsesOpenCV: 'FALSE'
VS2019_x64-msvc_debug_ninja:
CMakeArch: 'amd64'
BuildGenerator: 'Ninja'
CMakeConfiguration: 'debug'
MSBuildPlatform: 'x64'
MSBuildConfiguration: 'Debug'
vmImage: 'windows-2019'
UsesOpenCV: 'TRUE'
VS2019_x64-msvc_rel_ninja:
CMakeArch: 'amd64'
BuildGenerator: 'Ninja'
CMakeConfiguration: 'relwithdebinfo'
MSBuildPlatform: 'x64'
MSBuildConfiguration: 'Release'
vmImage: 'windows-2019'
UsesOpenCV: 'TRUE'
# VS2019 msbuild generators blocked by issue Microsoft/azure-pipelines-image-generation#754
# VS2019_x86_64-pc-windows-msvc_debug_msbuild:
# CMakeArch: 'amd64'
# BuildGenerator: 'Visual Studio 16 2019'
# CMakeConfiguration: 'debug'
# MSBuildPlatform: 'x64'
# MSBuildConfiguration: 'Debug'
# vmImage: 'windows-2019'
# VS2019_x86_64-pc-windows-msvc_relwithdebinfo_msbuild:
# CMakeArch: 'amd64'
# BuildGenerator: 'Visual Studio 16 2019'
# CMakeConfiguration: 'relwithdebinfo'
# MSBuildPlatform: 'x64'
# MSBuildConfiguration: 'Release'
# vmImage: 'windows-2019'
VS2019_x86-msvc_debug_ninja:
CMakeArch: 'x86'
BuildGenerator: 'Ninja'
CMakeConfiguration: 'debug'
MSBuildPlatform: 'x86'
MSBuildConfiguration: 'Debug'
vmImage: 'windows-2019'
UsesOpenCV: 'FALSE'
VS2019_x86-msvc_rel_ninja:
CMakeArch: 'x86'
BuildGenerator: 'Ninja'
CMakeConfiguration: 'relwithdebinfo'
MSBuildPlatform: 'x86'
MSBuildConfiguration: 'Release'
vmImage: 'windows-2019'
UsesOpenCV: 'FALSE'
# VS2019 msbuild generators blocked by issue Microsoft/azure-pipelines-image-generation#754
# VS2019_x86-pc-windows-msvc_debug_msbuild:
# CMakeArch: 'x86'
# BuildGenerator: 'Visual Studio 16 2019'
# CMakeConfiguration: 'debug'
# MSBuildPlatform: 'x86'
# MSBuildConfiguration: 'Debug'
# vmImage: 'windows-2019'
# VS2019_x86-pc-windows-msvc_relwithdebinfo_msbuild:
# CMakeArch: 'x86'
# BuildGenerator: 'Visual Studio 16 2019'
# CMakeConfiguration: 'relwithdebinfo'
# MSBuildPlatform: 'x86'
# MSBuildConfiguration: 'Release'
# vmImage: 'windows-2019'
pool:
vmImage: $(vmImage)
steps:
- checkout: self
clean: true
lfs: false
persistCredentials: true
submodules: true
# Use Python Version
# Retrieves the specified version of Python from the tool cache. Optionally add it to PATH.
- task: UsePythonVersion@0
inputs:
versionSpec: '3.x'
addToPath: true
architecture: 'x64'
- powershell: '$(Build.SourcesDirectory)/scripts/verify-windows.ps1'
displayName: 'Run verify-windows.ps1'
- script: |
git add --renormalize . && git diff-index --quiet HEAD --
IF %ERRORLEVEL% NEQ 0 (
echo "Please renormalize files before pushing using git add --renormalize ."
git status
exit /b 1
)
exit /b 0
displayName: 'Check Line Endings'
- task: BatchScript@1
displayName: 'Setup VS Env'
inputs:
filename: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat'
arguments: '-arch=$(CMakeArch)'
modifyEnvironment: true
condition: and(succeeded(), eq(variables['vmImage'], 'vs2017-win2016'))
- task: BatchScript@1
displayName: 'Setup VS Env'
inputs:
filename: 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat'
arguments: '-arch=$(CMakeArch)'
modifyEnvironment: true
condition: and(succeeded(), eq(variables['vmImage'], 'windows-2019'))
- pwsh: '$(Build.SourcesDirectory)/scripts/install-opencv.ps1'
displayName: 'Install OpenCV'
condition: and(succeeded(), eq(variables['UsesOpenCV'], 'TRUE'))
- powershell: |
$ErrorActionPreference = "Stop"
function Download-ToTemp
{
param
(
[Parameter(Mandatory)]
[string] $url,
[string] $filename
)
if (-not ($filename))
{
$filename = Split-Path -Path $url -Leaf
}
if (-not ($filename))
{
Write-Error "Unable to parse filename from $url"
return $null
}
$tempDir = [System.IO.Path]::GetTempPath()
$path = Join-Path -Path $tempDir -ChildPath $filename
Write-Host -NoNewline "Downloading $url to $path..."
Invoke-WebRequest -Uri $url -OutFile $path -UserAgent "NativeClient"
Write-Host "Done"
return $path
}
# Download NASM
$url = "https://www.nasm.us/pub/nasm/releasebuilds/2.14.02/win64/nasm-2.14.02-win64.zip"
$nasmzip = Download-ToTemp -url $url
Expand-Archive $nasmzip .\nasmexe
Write-Host "NASM Downloaded"
workingDirectory: '$(Build.BinariesDirectory)'
displayName: 'Download NASM'
- script: |
set PATH=%PATH%;$(Build.BinariesDirectory)\nasmexe\nasm-2.14.02
cmake -G "$(BuildGenerator)" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DOpenCV_REQUIRED=$(UsesOpenCV)" "$(Build.SourcesDirectory)" "-DCMAKE_BUILD_TYPE=$(CMakeConfiguration)" "-DK4A_SOURCE_LINK=ON"
workingDirectory: '$(Build.BinariesDirectory)'
displayName: 'CMake Configure'
env:
CC: cl
CXX: cl
- task: CMake@1
displayName: 'CMake Build'
inputs:
workingDirectory: '$(Build.BinariesDirectory)'
cmakeArgs: '--build . --config "$(CMakeConfiguration)"'
- task: CMake@1
displayName: 'CMake Build Package'
inputs:
workingDirectory: '$(Build.BinariesDirectory)'
cmakeArgs: '--build . --config "$(CMakeConfiguration)" --target package'
- script: 'ctest -V -C "$(CMakeConfiguration)" -L unit'
workingDirectory: '$(Build.BinariesDirectory)'
displayName: 'Run Native Unit Tests'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '**\TEST-*.xml'
searchFolder: '$(Build.BinariesDirectory)'
mergeTestResults: true
testRunTitle: 'Unit Tests'
condition: succeededOrFailed()
# Create a placeholder version of the depth engine to satisfy MSBuild copy rules.
# This version is not needed for actual execution.
# In the future we should fetch the real version from a valid source.
- powershell: |
if ("$(BuildGenerator)" -eq "Ninja")
{
IF(-Not (Test-Path "$(Build.BinariesDirectory)\bin\depthengine_2_0.dll")) { Add-Content "$(Build.BinariesDirectory)\bin\depthengine_2_0.dll" "Placeholder file, please download real depth engine." }
}
elseif ("$(BuildGenerator)" -like "Visual Studio *")
{
IF(-Not (Test-Path "$(Build.BinariesDirectory)\bin\$(CMakeConfiguration)\depthengine_2_0.dll")) { Add-Content "$(Build.BinariesDirectory)\bin\$(CMakeConfiguration)\depthengine_2_0.dll" "Placeholder file, please download real depth engine." }
}
else
{
Write-Error "Unknown Generator <<$(BuildGenerator)>>"
}
displayName: 'Create placeholder depth engine'
- task: NuGetToolInstaller@0
inputs:
versionSpec: '>=4.3.1'
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 # NuGetCommand@2
inputs:
command: 'restore'
solution: '$(Build.SourcesDirectory)\src\csharp\K4a.sln'
- task: VSBuild@1
displayName: 'Build C# Wrappers'
inputs:
solution: '$(Build.SourcesDirectory)\src\csharp\K4a.sln'
msbuildArgs: '/p:BaseOutputPath="$(Build.BinariesDirectory)\bin\$(MSBuildConfiguration)\\"'
platform: '$(MSBuildPlatform)'
configuration: '$(MSBuildConfiguration)'
- task: VSTest@2
displayName: 'Run C# Unit Tests'
inputs:
testSelector: 'testAssemblies'
searchFolder: '$(Build.BinariesDirectory)\bin'
platform: '$(MSBuildPlatform)'
configuration: '$(MSBuildConfiguration)'
testAssemblyVer2: |
**/*UnitTests.dll
!**/obj/**
# Clean up any placeholder version of the depth engine that were created.
- powershell: Get-ChildItem -Path "$(Build.BinariesDirectory)\bin\\" -Filter "DepthEngine_*.dll" -Recurse | Remove-Item
displayName: 'Clean up temp depth engine'
- task: CopyFiles@2
displayName: 'Copy build folder to Staging'
inputs:
SourceFolder: '$(Build.BinariesDirectory)'
Contents: |
*
bin/**/*
docs/**/*
CMakeFiles/**/*
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Build folder'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(CMakeArch)-windows-msvc-$(CMakeConfiguration)'
parallel: true
parallelCount: 8
condition: and(succeeded(), and(eq(variables['vmImage'], 'vs2017-win2016'), eq(variables['BuildGenerator'], 'Ninja')))
# This will publish symbols created from this build to the Azure DevOps symbol
# server. This symbol server will be private to Microsoft internal.
- task: PublishSymbols@2
displayName: 'Publish K4A Symbols'
inputs:
symbolsFolder: '$(Build.BinariesDirectory)'
searchPattern: 'bin/**/*.pdb'
indexSources: true
publishSymbols: true
symbolServerType: 'teamServices'
condition: and(succeeded(), and(eq(variables['vmImage'], 'vs2017-win2016'), eq(variables['BuildGenerator'], 'Ninja')))
- job: LinuxK4ABuildTest
displayName: Linux
strategy:
maxParallel: 100
matrix:
x64-clang_debug_ninja:
CMakeLinuxTargetTriple: 'x86_64-linux-clang'
CMakeConfiguration: 'debug'
UsesOpenCV: 'TRUE'
container: 'mcr.microsoft.com/akbuilder-linux:v5-amd64'
x64-gnu_debug_ninja:
CMakeLinuxTargetTriple: 'x86_64-linux-gnu'
CMakeConfiguration: 'debug'
UsesOpenCV: 'TRUE'
container: 'mcr.microsoft.com/akbuilder-linux:v5-amd64'
x64-clang_rel_ninja:
CMakeLinuxTargetTriple: 'x86_64-linux-clang'
CMakeConfiguration: 'relwithdebinfo'
UsesOpenCV: 'TRUE'
container: 'mcr.microsoft.com/akbuilder-linux:v5-amd64'
x64-gnu_rel_ninja:
CMakeLinuxTargetTriple: 'x86_64-linux-gnu'
CMakeConfiguration: 'relwithdebinfo'
UsesOpenCV: 'TRUE'
container: 'mcr.microsoft.com/akbuilder-linux:v5-amd64'
# arm64-clang_debug_ninja:
# CMakeLinuxTargetTriple: 'arm64-linux-clang'
# CMakeConfiguration: 'debug'
# UsesOpenCV: 'FALSE'
arm64-gnu_debug_ninja:
CMakeLinuxTargetTriple: 'arm64-linux-gnu'
CMakeConfiguration: 'debug'
UsesOpenCV: 'FALSE'
container: 'mcr.microsoft.com/akbuilder-linux:v5-arm64'
# arm64-clang_rel_ninja:
# CMakeLinuxTargetTriple: 'arm64-linux-clang'
# CMakeConfiguration: 'relwithdebinfo'
# UsesOpenCV: 'FALSE'
arm64-gnu_rel_ninja:
CMakeLinuxTargetTriple: 'arm64-linux-gnu'
CMakeConfiguration: 'relwithdebinfo'
UsesOpenCV: 'FALSE'
container: 'mcr.microsoft.com/akbuilder-linux:v5-arm64'
# 32-bit builds are currently broken
# i386-unknown-linux-clang_debug_ninja:
# CMakeLinuxTargetTriple: 'i386-linux-clang'
# CMakeConfiguration: 'debug'
# i386-unknown-linux-gnu_debug_ninja:
# CMakeLinuxTargetTriple: 'i386-linux-gnu'
# CMakeConfiguration: 'debug'
# i386-unknown-linux-clang_relwithdebinfo_ninja:
# CMakeLinuxTargetTriple: 'i386-linux-clang'
# CMakeConfiguration: 'relwithdebinfo'
# i386-unknown-linux-gnu_relwithdebinfo_ninja:
# CMakeLinuxTargetTriple: 'i386-linux-gnu'
# CMakeConfiguration: 'relwithdebinfo'
pool:
vmImage: 'ubuntu-18.04'
container: $[ variables['container'] ]
steps:
- checkout: self
clean: true
lfs: false
persistCredentials: true
submodules: true
- script: |
git add --renormalize . && git diff-index --quiet HEAD --
if [ $? -ne 0 ]
then
echo "Please normalize files before pushing using git add --renormalize ."
git status
exit 1
fi
displayName: 'Check Line Endings'
# OpenCV always required on Linux
- script: 'cmake -GNinja -DCMAKE_VERBOSE_MAKEFILE=ON -DOpenCV_REQUIRED=$(UsesOpenCV) "$(Build.SourcesDirectory)" "-DCMAKE_BUILD_TYPE=$(CMakeConfiguration)" "-DCMAKE_TOOLCHAIN_FILE=$(Build.SourcesDirectory)/cmake/toolchains/$(CMakeLinuxTargetTriple).cmake"'
workingDirectory: '$(Build.BinariesDirectory)'
displayName: 'CMake Configure'
- task: CMake@1
displayName: 'CMake Build'
inputs:
workingDirectory: '$(Build.BinariesDirectory)'
cmakeArgs: '--build .'
- task: CMake@1
displayName: 'CMake Build Package'
inputs:
workingDirectory: '$(Build.BinariesDirectory)'
cmakeArgs: '--build . --target package'
- script: 'ctest -V -L unit'
workingDirectory: '$(Build.BinariesDirectory)'
displayName: 'Unit Tests'
- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
searchFolder: '$(Build.BinariesDirectory)'
mergeTestResults: true
testRunTitle: 'Unit Tests'
condition: succeededOrFailed()
- task: CopyFiles@2
displayName: 'Copy build folder to Staging'
inputs:
SourceFolder: '$(Build.BinariesDirectory)'
Contents: |
*
bin/*
docs/**/*
CMakeFiles/**/*
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Build folder'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: '$(CMakeLinuxTargetTriple)-$(CMakeConfiguration)'
parallel: true
parallelCount: 8
condition: and(succeeded(), contains(variables['CMakeLinuxTargetTriple'], 'gnu'))
- job: DocumentationBuild
displayName: Documentation Build
pool:
vmImage: 'vs2017-win2016'
demands:
- Cmd
steps:
- checkout: self
clean: true
lfs: false
persistCredentials: true
submodules: true
- task: BatchScript@1
displayName: 'Setup VS2017 Env'
inputs:
filename: 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Tools\VsDevCmd.bat'
modifyEnvironment: true
- powershell: |
$ErrorActionPreference = "Stop"
function Download-ToTemp
{
param
(
[Parameter(Mandatory)]
[string] $url,
[string] $filename
)
if (-not ($filename))
{
$filename = Split-Path -Path $url -Leaf
}
if (-not ($filename))
{
Write-Error "Unable to parse filename from $url"
return $null
}
$tempDir = [System.IO.Path]::GetTempPath()
$path = Join-Path -Path $tempDir -ChildPath $filename
Write-Host -NoNewline "Downloading $url to $path..."
Invoke-WebRequest -Uri $url -OutFile $path -UserAgent "NativeClient"
Write-Host "Done"
return $path
}
# Download Doxygen
$url = "https://sourceforge.net/projects/doxygen/files/rel-1.8.14/doxygen-1.8.14.windows.bin.zip/download"
$filename = "doxygen-1.8.14.windows.bin.zip"
$doxygenzip = Download-ToTemp -url $url -filename $filename
Expand-Archive $doxygenzip .\doxygenexe
Write-Host "Doxygen installed. Please use Visual Studio Developer Command prompt to build."
workingDirectory: '$(Build.BinariesDirectory)'
displayName: 'Download doxygen'
- script: |
set PATH=%PATH%;$(Build.BinariesDirectory)\doxygenexe
cmake -G Ninja "-DK4A_BUILD_DOCS:BOOL=ON" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DSOURCE_BRANCH=$(Build.SourceBranch)" "$(Build.SourcesDirectory)"
workingDirectory: '$(Build.BinariesDirectory)'
displayName: 'CMake Configure'
env:
CC: cl
CXX: cl
- task: CMake@1
displayName: 'CMake Build'
inputs:
workingDirectory: '$(Build.BinariesDirectory)'
cmakeArgs: '--build . --target k4adocs'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: Documentation'
inputs:
PathtoPublish: '$(Build.BinariesDirectory)\docs'
ArtifactName: docs
parallel: true
parallelCount: 8
- task: PowerShell@2
displayName: 'Publish Documentation HTML'
inputs:
targetType: 'filePath'
filePath: '$(Build.SourcesDirectory)\doxygen\PublishDocs.ps1'
condition: and(eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564'), and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')))
- ${{ if eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564') }}:
- job: WindowsFunctionalTests
displayName: Windows Functional Test
dependsOn: WindowsK4ABuildTest
variables:
firmware_version: "$(windows_firmware_version)"
pool:
name: Analog-FwConnected
demands:
- Eden
- Agent.OS -equals Windows_NT
steps:
- task: VisualStudioTestPlatformInstaller@1
displayName: 'Install Visual Studio Test Platform tools'
- checkout: self
clean: true
lfs: false
persistCredentials: true
submodules: false
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
artifactName: 'amd64-windows-msvc-RelWithDebInfo'
parallelizationLimit: 8
- task: NuGetToolInstaller@0
inputs:
versionSpec: '>=5.1.0'
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 #NugetCommand@2
displayName: "Get Azure Kinect NuGet Package"
inputs:
command: custom
arguments: install Microsoft.Azure.Kinect.Sensor -prerelease -Version $(NuGetPackageVersion) -OutputDirectory $(System.ArtifactsDirectory)/NugetOutputDir
- task: CopyFiles@2
displayName: "Copy DepthEngine into amd64/debug artifacts folder"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir/Microsoft.Azure.Kinect.Sensor.$(NuGetPackageVersion)/lib/native/amd64/release/"
contents: "depthengine*.dll"
targetFolder: "$(System.ArtifactsDirectory)/depthengineplugin/windows/amd64/debug"
flattenFolders: true
- task: CopyFiles@2
displayName: "Copy DepthEngine into amd64/release artifacts folder"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir/Microsoft.Azure.Kinect.Sensor.$(NuGetPackageVersion)/lib/native/amd64/release/"
contents: "depthengine*.dll"
targetFolder: "$(System.ArtifactsDirectory)/depthengineplugin/windows/amd64/release"
flattenFolders: true
- task: CopyFiles@2
displayName: "Copy DepthEngine into x86/debug artifacts folder"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir/Microsoft.Azure.Kinect.Sensor.$(NuGetPackageVersion)/lib/native/x86/release/"
contents: "depthengine*.dll"
targetFolder: "$(System.ArtifactsDirectory)/depthengineplugin/windows/x86/debug"
flattenFolders: true
- task: CopyFiles@2
displayName: "Copy DepthEngine into x86/release artifacts folder"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir/Microsoft.Azure.Kinect.Sensor.$(NuGetPackageVersion)/lib/native/x86/release/"
contents: "depthengine*.dll"
targetFolder: "$(System.ArtifactsDirectory)/depthengineplugin/windows/x86/release"
flattenFolders: true
- task: CopyFiles@2
displayName: "Copy AzureKinectDK_Fw_$(firmware_version).bin artifacts folder"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir/Microsoft.Azure.Kinect.Sensor.$(NuGetPackageVersion)/firmware/"
contents: "AzureKinectDK_Fw_$(firmware_version).bin"
targetFolder: "$(System.ArtifactsDirectory)/firmware"
flattenFolders: true
# we don't want to test other binaries in the NuGet package, so delete it.
- task: DeleteFiles@1
displayName: "Delete Microsoft.Azure.Kinect.Sensor NuGet Package"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir"
contents: '\*'
- task: CopyFiles@2
displayName: "Copy DepthEngine into bin folder"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/depthengineplugin/windows/amd64/release/"
contents: "depthengine*.dll"
targetFolder: "$(System.ArtifactsDirectory)/amd64-windows-msvc-relwithdebinfo/bin"
flattenFolders: true
- task: CopyFiles@2
displayName: "Copy DepthEngine into C# functional tests folder"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/depthengineplugin/windows/amd64/release/"
contents: "depthengine*.dll"
targetFolder: "$(System.ArtifactsDirectory)/amd64-windows-msvc-relwithdebinfo/bin/Release/Microsoft.AzureKinect.FunctionalTests/netcoreapp2.1/"
flattenFolders: true
- script: '.\amd64-windows-msvc-relwithdebinfo\bin\AzureKinectFirmwareTool.exe -r'
workingDirectory: '$(System.ArtifactsDirectory)'
displayName: 'Reset K4A Device'
- script: '.\amd64-windows-msvc-relwithdebinfo\bin\AzureKinectFirmwareTool.exe -u firmware/AzureKinectDK_Fw_$(firmware_version).bin'
workingDirectory: '$(System.ArtifactsDirectory)'
displayName: 'Update Device'
- script: '.\amd64-windows-msvc-relwithdebinfo\bin\enumerate_devices.exe'
workingDirectory: '$(System.ArtifactsDirectory)'
displayName: 'Check Device Health'
- script: 'python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_test_list.txt --bin bin/ --output=xml --gtest_filter=-*ONBOARDING*'
workingDirectory: '$(System.ArtifactsDirectory)/amd64-windows-msvc-relwithdebinfo'
displayName: 'Run Functional Tests'
timeoutInMinutes: 15
- script: 'python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_custom_test_list.txt --bin bin/ --output=xml --gtest_filter=-*ONBOARDING*'
workingDirectory: '$(System.ArtifactsDirectory)/amd64-windows-msvc-relwithdebinfo'
displayName: 'Run Custom Functional Tests'
timeoutInMinutes: 15
- script: 'python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_test_list.txt --bin bin/ --output=xml --gtest_filter=*ONBOARDING*'
workingDirectory: '$(System.ArtifactsDirectory)/amd64-windows-msvc-relwithdebinfo'
displayName: 'Run Functional Tests - Onboarding'
timeoutInMinutes: 15
continueOnError: true
- task: VSTest@2
displayName: 'Run C# Functional Tests'
inputs:
testSelector: 'testAssemblies'
searchFolder: '$(Build.BinariesDirectory)'
platform: '$(MSBuildPlatform)'
configuration: '$(MSBuildConfiguration)'
vsTestVersion: 'toolsInstaller'
testAssemblyVer2: |
**/*FunctionalTests.dll
!**/obj/**
- ${{ if eq(variables['System.CollectionId'], 'cb55739e-4afe-46a3-970f-1b49d8ee7564') }}:
- job: LinuxFunctionalTests
displayName: Linux Functional Test
dependsOn: LinuxK4ABuildTest
variables:
firmware_version: "$(linux_firmware_version)"
strategy:
maxParallel: 100
matrix:
x86_64:
CMakeLinuxTargetTriple: 'x86_64-linux-gnu'
EdenArch: 'x64'
arm64:
CMakeLinuxTargetTriple: 'arm64-linux-gnu'
EdenArch: 'arm64'
pool:
name: Analog-FwConnected
demands:
- EdenArch -equals $(EdenArch)
- Agent.OS -equals Linux
steps:
- checkout: self
clean: true
lfs: false
persistCredentials: true
submodules: true
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
artifactName: '$(CMakeLinuxTargetTriple)-relwithdebinfo'
parallelizationLimit: 8
- task: NuGetToolInstaller@0
inputs:
versionSpec: '>=5.1.0'
# The account on the NUC does not currently give this user permission to install, so we have done so manually.
# Mono has a bug, so we need a newer version. Version 6.8 is working well for both AMD64 and ARM64.
#- script: 'apt-get install mono-complete python git-lfs openssh-server ufw libopencv-dev'
# workingDirectory: '$(System.ArtifactsDirectory)'
# displayName: "Ensure Mono is installed"
- task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 #NugetCommand@2
displayName: "Get Azure Kinect NuGet Package"
inputs:
command: custom
arguments: install Microsoft.Azure.Kinect.Sensor -prerelease -Version $(NuGetPackageVersion) -OutputDirectory $(System.ArtifactsDirectory)/NugetOutputDir
- script: 'ls -alR'
workingDirectory: '$(System.ArtifactsDirectory)/NugetOutputDir'
displayName: "Temp List files"
- task: CopyFiles@2
displayName: "Copy DepthEngine into $(EdenArch)/debug artifacts folder"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir/Microsoft.Azure.Kinect.Sensor.$(NuGetPackageVersion)/linux/lib/native/$(EdenArch)/release/"
contents: "libdepthengine*"
targetFolder: "$(System.ArtifactsDirectory)/depthengineplugin/linux/$(EdenArch)/debug"
flattenFolders: true
- task: CopyFiles@2
displayName: "Copy DepthEngine into $(EdenArch)/release artifacts folder"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir/Microsoft.Azure.Kinect.Sensor.$(NuGetPackageVersion)/linux/lib/native/$(EdenArch)/release/"
contents: "libdepthengine*"
targetFolder: "$(System.ArtifactsDirectory)/depthengineplugin/linux/$(EdenArch)/release"
flattenFolders: true
- task: CopyFiles@2
displayName: "Copy AzureKinectDK_Fw_$(firmware_version).bin artifacts folder"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir/Microsoft.Azure.Kinect.Sensor.$(NuGetPackageVersion)/firmware/"
contents: "AzureKinectDK_Fw_$(firmware_version).bin"
targetFolder: "$(System.ArtifactsDirectory)/firmware"
flattenFolders: true
# we don't want to test other binaries in the NuGet package, so delete it.
- task: DeleteFiles@1
displayName: "Delete Microsoft.Azure.Kinect.Sensor NuGet Package"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/NugetOutputDir"
contents: '\*'
- task: CopyFiles@2
displayName: "Copy DepthEnginePlugin into Build Artifacts"
inputs:
sourceFolder: "$(System.ArtifactsDirectory)/depthengineplugin/linux/$(EdenArch)/release/"
contents: "libdepthengine.so*"
targetFolder: "$(System.ArtifactsDirectory)/$(CMakeLinuxTargetTriple)-relwithdebinfo/bin/"
flattenFolders: true
- script: 'chmod +x ./$(CMakeLinuxTargetTriple)-relwithdebinfo/bin/*'
workingDirectory: '$(System.ArtifactsDirectory)'
displayName: 'Add execution property to binary files'
# Set and verify the DISPLAY variable since DepthEngine needs to open a display window (even there is no visual display).
- script: |
echo
echo Checking OpenGL version on DISPLAY=:0
echo "##vso[task.setvariable variable=DISPLAY]:0"
export DISPLAY=:0
env | grep DISPLAY
which xauth
glxinfo | grep "OpenGL"
if [ $? -ne 0 ] ; then
echo
echo Checking OpenGL version on DISPLAY=:1
echo "##vso[task.setvariable variable=DISPLAY]:1"
export DISPLAY=:1
env | grep DISPLAY
which xauth
glxinfo | grep "OpenGL"
fi
workingDirectory: '$(System.ArtifactsDirectory)'
displayName: 'Check openGL version'
timeoutInMinutes: 5
- script: './$(CMakeLinuxTargetTriple)-relwithdebinfo/bin/AzureKinectFirmwareTool -r'
workingDirectory: '$(System.ArtifactsDirectory)'
displayName: 'Reset K4A Device'
env:
K4A_LOG_LEVEL: 'I'
- script: './$(CMakeLinuxTargetTriple)-relwithdebinfo/bin/AzureKinectFirmwareTool -u firmware/AzureKinectDK_Fw_$(firmware_version).bin'
workingDirectory: '$(System.ArtifactsDirectory)'
displayName: 'Update Device'
env:
K4A_LOG_LEVEL: 'I'
- script: './$(CMakeLinuxTargetTriple)-relwithdebinfo/bin/enumerate_devices'
workingDirectory: '$(System.ArtifactsDirectory)'
displayName: 'Check Device Health'
- script: 'python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_test_list.txt --bin bin/ --output=xml --gtest_filter=-*ONBOARDING*'
workingDirectory: '$(System.ArtifactsDirectory)/$(CMakeLinuxTargetTriple)-relwithdebinfo'
displayName: 'Run Functional Tests'
timeoutInMinutes: 15
- script: 'python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_custom_test_list.txt --bin bin/ --output=xml --gtest_filter=-*ONBOARDING*'
workingDirectory: '$(System.ArtifactsDirectory)/$(CMakeLinuxTargetTriple)-relwithdebinfo'
displayName: 'Run Custom Functional Tests'
timeoutInMinutes: 15
- script: 'python $(Build.SourcesDirectory)/scripts/RunTestList.py --list bin/functional_test_list.txt --bin bin/ --output=xml --gtest_filter=*ONBOARDING*'
workingDirectory: '$(System.ArtifactsDirectory)/$(CMakeLinuxTargetTriple)-relwithdebinfo'
displayName: 'Run Functional Tests - Onboarding'
timeoutInMinutes: 15
continueOnError: true