@@ -11,71 +11,138 @@ parameters:
1111 gtestFlags : ' --gtest_output=xml:$(Build.ArtifactStagingDirectory)/testOut/'
1212
1313jobs :
14- - template : /eng/common/templates/job/job.yml
15- parameters :
16- name : ${{ coalesce(parameters.jobName, parameters.agentOs) }}
17- displayName : ${{ coalesce(parameters.jobName, parameters.agentOs) }}
18- dependsOn : ${{ parameters.dependsOn }}
19- timeoutInMinutes : ${{ parameters.timeoutInMinutes }}
20- enablePublishBuildAssets : false
21- ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(parameters.agentOs, 'Windows')) }} :
22- enablePublishUsingPipelines : ${{ variables._PublishUsingPipelines }}
23- enablePublishTestResults : true # publish test results to AzDO (populates AzDO Tests tab)
24- enableTelemetry : true
25- pool :
26- ${{ if eq(parameters.agentOs, 'macOS') }} :
27- vmImage : macOS-11
28- ${{ if eq(parameters.agentOs, 'Linux') }} :
29- vmImage : ubuntu-20.04
30- ${{ if eq(parameters.agentOs, 'Windows') }} :
31- vmImage : windows-2019
32- steps :
33- - checkout : self
34- clean : true
14+ - ${{ if ne(variables['System.TeamProject'], 'internal') }} :
15+ - template : /eng/common/templates/job/job.yml@self
16+ parameters :
17+ name : ${{ coalesce(parameters.jobName, parameters.agentOs) }}
18+ displayName : ${{ coalesce(parameters.jobName, parameters.agentOs) }}
19+ dependsOn : ${{ parameters.dependsOn }}
20+ timeoutInMinutes : ${{ parameters.timeoutInMinutes }}
21+ enablePublishBuildAssets : false
22+ enablePublishTestResults : true # publish test results to AzDO (populates AzDO Tests tab)
23+ enableTelemetry : true
24+ pool :
25+ ${{ if eq(parameters.agentOs, 'macOS') }} :
26+ vmImage : macOS-12
27+ ${{ if eq(parameters.agentOs, 'Linux') }} :
28+ vmImage : ubuntu-20.04
29+ ${{ if eq(parameters.agentOs, 'Windows') }} :
30+ vmImage : windows.vs2019.amd64
31+ steps :
32+ - checkout : self
33+ clean : true
3534
36- - task : CacheBeta@1
37- inputs :
38- key : vcpkg | ${{ parameters.agentOs }} | azure-pipelines.yml
39- path : ./submodules/vcpkg/installed
40- cacheHitVar : CACHE_RESTORED
41- displayName : Cache vcpkg packages
42- condition : eq( '${{ parameters.useCppRestSDK }}', 'true' )
35+ - task : CacheBeta@1
36+ inputs :
37+ key : vcpkg | ${{ parameters.agentOs }} | azure-pipelines.yml
38+ path : ./submodules/vcpkg/installed
39+ cacheHitVar : CACHE_RESTORED
40+ displayName : Cache vcpkg packages
41+ condition : eq( '${{ parameters.useCppRestSDK }}', 'true' )
4342
44- - ${{ parameters.beforeBuild }}
43+ - ${{ parameters.beforeBuild }}
4544
46- - task : CMake@1
47- inputs :
48- cmakeArgs : .. ${{ parameters.cMakeRunArgs }} -DCMAKE_TOOLCHAIN_FILE=../submodules/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=${{ parameters.configuration }} -DUSE_CPPRESTSDK=${{ parameters.useCppRestSDK }} -DUSE_MSGPACK=true
49- workingDirectory : ' build.${{ parameters.configuration }}'
50- displayName : Create build files
51- - task : CMake@1
52- inputs :
53- cmakeArgs : --build . --config ${{ parameters.configuration }}
54- workingDirectory : ' build.${{ parameters.configuration }}'
55- displayName : Build client
56- - ${{ if eq(parameters.agentOs, 'macOS') }} :
57- - bash : " ./run-tests.sh ./build.${{ parameters.configuration }}/bin/signalrclienttests ${{ parameters.gtestFlags }}"
58- condition : eq( variables['Agent.OS'], 'Darwin' )
59- displayName : Run tests
60- - ${{ if eq(parameters.agentOs, 'Linux') }} :
61- - bash : " ./run-tests.sh valgrind --leak-check=yes --leak-check=full --error-exitcode=1 --track-origins=yes ./build.${{ parameters.configuration }}/bin/signalrclienttests ${{ parameters.gtestFlags }}"
62- condition : eq( variables['Agent.OS'], 'Linux' )
63- displayName : Run tests
64- - ${{ if eq(parameters.agentOs, 'Windows') }} :
65- - powershell : " & ./build.${{ parameters.configuration }}/bin/${{ parameters.configuration }}/signalrclienttests.exe ${{ parameters.gtestFlags }}"
66- condition : eq( variables['Agent.OS'], 'Windows_NT' )
67- displayName : Run tests
45+ - task : CMake@1
46+ inputs :
47+ cmakeArgs : .. ${{ parameters.cMakeRunArgs }} -DCMAKE_TOOLCHAIN_FILE=../submodules/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=${{ parameters.configuration }} -DUSE_CPPRESTSDK=${{ parameters.useCppRestSDK }} -DUSE_MSGPACK=true
48+ workingDirectory : ' build.${{ parameters.configuration }}'
49+ displayName : Create build files
50+ - task : CMake@1
51+ inputs :
52+ cmakeArgs : --build . --config ${{ parameters.configuration }}
53+ workingDirectory : ' build.${{ parameters.configuration }}'
54+ displayName : Build client
55+ - ${{ if eq(parameters.agentOs, 'macOS') }} :
56+ - bash : " ./run-tests.sh ./build.${{ parameters.configuration }}/bin/signalrclienttests ${{ parameters.gtestFlags }}"
57+ condition : eq( variables['Agent.OS'], 'Darwin' )
58+ displayName : Run tests
59+ - ${{ if eq(parameters.agentOs, 'Linux') }} :
60+ - bash : " ./run-tests.sh valgrind --leak-check=yes --leak-check=full --error-exitcode=1 --track-origins=yes ./build.${{ parameters.configuration }}/bin/signalrclienttests ${{ parameters.gtestFlags }}"
61+ condition : eq( variables['Agent.OS'], 'Linux' )
62+ displayName : Run tests
63+ - ${{ if eq(parameters.agentOs, 'Windows') }} :
64+ - powershell : " & ./build.${{ parameters.configuration }}/bin/${{ parameters.configuration }}/signalrclienttests.exe ${{ parameters.gtestFlags }}"
65+ condition : eq( variables['Agent.OS'], 'Windows_NT' )
66+ displayName : Run tests
6867
69- - script : " echo ##vso[build.addbuildtag]CodeQL3000"
70- displayName : ' Set CI CodeQL3000 tag'
71- condition : ne(variables.CODEQL_DIST,'')
68+ - ${{ parameters.afterBuild }}
7269
73- - ${{ parameters.afterBuild }}
70+ - task : PublishTestResults@2
71+ displayName : Publish test results
72+ condition : always()
73+ inputs :
74+ testRunner : junit
75+ testResultsFiles : ' $(Build.ArtifactStagingDirectory)/testOut/**/*.xml'
76+ testRunTitle : ${{ parameters.agentOs }}-unit_test
7477
75- - task : PublishTestResults@2
76- displayName : Publish test results
77- condition : always()
78- inputs :
79- testRunner : junit
80- testResultsFiles : ' $(Build.ArtifactStagingDirectory)/testOut/**/*.xml'
81- testRunTitle : ${{ parameters.agentOs }}-unit_test
78+ - ${{ if eq(variables['System.TeamProject'], 'internal') }} :
79+ - template : /eng/common/templates-official/job/job.yml@self
80+ parameters :
81+ name : ${{ coalesce(parameters.jobName, parameters.agentOs) }}
82+ displayName : ${{ coalesce(parameters.jobName, parameters.agentOs) }}
83+ dependsOn : ${{ parameters.dependsOn }}
84+ timeoutInMinutes : ${{ parameters.timeoutInMinutes }}
85+ enablePublishBuildAssets : false
86+ ${{ if and(eq(variables['System.TeamProject'], 'internal'), eq(parameters.agentOs, 'Windows')) }} :
87+ enablePublishUsingPipelines : ${{ variables._PublishUsingPipelines }}
88+ enablePublishTestResults : true # publish test results to AzDO (populates AzDO Tests tab)
89+ enableTelemetry : true
90+ pool :
91+ ${{ if eq(parameters.agentOs, 'macOS') }} :
92+ name : Azure Pipelines
93+ image : macOS-12
94+ os : macOS
95+ ${{ if eq(parameters.agentOs, 'Linux') }} :
96+ name : $(DncEngInternalBuildPool)
97+ image : 1es-ubuntu-2004
98+ os : linux
99+ ${{ if eq(parameters.agentOs, 'Windows') }} :
100+ name : $(DncEngInternalBuildPool)
101+ image : windows.vs2019.amd64
102+ os : windows
103+ steps :
104+ - checkout : self
105+ clean : true
106+
107+ - task : CacheBeta@1
108+ inputs :
109+ key : vcpkg | ${{ parameters.agentOs }} | azure-pipelines.yml
110+ path : ./submodules/vcpkg/installed
111+ cacheHitVar : CACHE_RESTORED
112+ displayName : Cache vcpkg packages
113+ condition : eq( '${{ parameters.useCppRestSDK }}', 'true' )
114+
115+ - ${{ parameters.beforeBuild }}
116+
117+ - task : CMake@1
118+ inputs :
119+ cmakeArgs : .. ${{ parameters.cMakeRunArgs }} -DCMAKE_TOOLCHAIN_FILE=../submodules/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=${{ parameters.configuration }} -DUSE_CPPRESTSDK=${{ parameters.useCppRestSDK }} -DUSE_MSGPACK=true
120+ workingDirectory : ' build.${{ parameters.configuration }}'
121+ displayName : Create build files
122+ - task : CMake@1
123+ inputs :
124+ cmakeArgs : --build . --config ${{ parameters.configuration }}
125+ workingDirectory : ' build.${{ parameters.configuration }}'
126+ displayName : Build client
127+ - ${{ if eq(parameters.agentOs, 'macOS') }} :
128+ - bash : " ./run-tests.sh ./build.${{ parameters.configuration }}/bin/signalrclienttests ${{ parameters.gtestFlags }}"
129+ condition : eq( variables['Agent.OS'], 'Darwin' )
130+ displayName : Run tests
131+ - ${{ if eq(parameters.agentOs, 'Linux') }} :
132+ - bash : " ./run-tests.sh valgrind --leak-check=yes --leak-check=full --error-exitcode=1 --track-origins=yes ./build.${{ parameters.configuration }}/bin/signalrclienttests ${{ parameters.gtestFlags }}"
133+ condition : eq( variables['Agent.OS'], 'Linux' )
134+ displayName : Run tests
135+ - ${{ if eq(parameters.agentOs, 'Windows') }} :
136+ - powershell : " & ./build.${{ parameters.configuration }}/bin/${{ parameters.configuration }}/signalrclienttests.exe ${{ parameters.gtestFlags }}"
137+ condition : eq( variables['Agent.OS'], 'Windows_NT' )
138+ displayName : Run tests
139+
140+ - ${{ parameters.afterBuild }}
141+
142+ - task : PublishTestResults@2
143+ displayName : Publish test results
144+ condition : always()
145+ inputs :
146+ testRunner : junit
147+ testResultsFiles : ' $(Build.ArtifactStagingDirectory)/testOut/**/*.xml'
148+ testRunTitle : ${{ parameters.agentOs }}-unit_test
0 commit comments