Skip to content

Commit ca4897e

Browse files
authored
Convert pipeline to 1ES (#101)
* Update deps from Arcade * Revert "Fixup CodeQL3000 injection (#91)" This reverts commit facb478. * Revert "Add Codeql (#89)" This reverts commit 39f6cb1. * Convert to 1ES * Fix pools * Fix again
1 parent 37dc622 commit ca4897e

File tree

97 files changed

+3826
-1466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3826
-1466
lines changed

.azure/default-build.yml

Lines changed: 129 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -11,71 +11,138 @@ parameters:
1111
gtestFlags: '--gtest_output=xml:$(Build.ArtifactStagingDirectory)/testOut/'
1212

1313
jobs:
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

.config/tsaoptions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
"projectName": "DEVDIV",
1010
"repositoryName": "SignalR-Client-Cpp",
1111
"template": "TFSDEVDIV"
12-
}
12+
}

azure-pipelines-public.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
variables:
2+
# used for SDL and arcade
3+
- name: _TeamName
4+
value: AspNetCore
5+
- name: _DotNetPublishToBlobFeed
6+
value: true
7+
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
8+
value: true
9+
- name: _PublishUsingPipelines
10+
value: true
11+
- name: _DotNetArtifactsCategory
12+
value: SIGNALR_CPP
13+
- name: _DotNetValidationArtifactsCategory
14+
value: SIGNALR_CPP
15+
- name: Build.Repository.Clean
16+
value: true
17+
- name: _BuildConfig
18+
value: 'Debug'
19+
20+
trigger:
21+
- main
22+
23+
stages:
24+
- stage: build
25+
displayName: Build
26+
jobs:
27+
- template: .azure/default-build.yml
28+
parameters:
29+
agentOs: Windows
30+
jobName: Windows_Build_Test_With_CppRestSDK
31+
useCppRestSDK: true
32+
cMakeRunArgs: '-A x64'
33+
beforeBuild:
34+
- powershell: "& ./submodules/vcpkg/bootstrap-vcpkg.bat"
35+
condition: ne(variables.CACHE_RESTORED, 'true')
36+
displayName: Bootstrap vcpkg
37+
- powershell: "& ./submodules/vcpkg/vcpkg.exe install cpprestsdk[websockets]:x64-windows msgpack:x64-windows jsoncpp:x64-windows --vcpkg-root ./submodules/vcpkg"
38+
condition: ne(variables.CACHE_RESTORED, 'true')
39+
displayName: vcpkg install dependencies
40+
41+
- template: .azure/default-build.yml
42+
parameters:
43+
agentOs: macOs
44+
jobName: Mac_Build_Test_With_CppRestSDK
45+
useCppRestSDK: true
46+
beforeBuild:
47+
- bash: "./submodules/vcpkg/bootstrap-vcpkg.sh --allowAppleClang"
48+
condition: ne(variables.CACHE_RESTORED, 'true')
49+
displayName: Bootstrap vcpkg
50+
- bash: "./submodules/vcpkg/vcpkg install cpprestsdk[websockets] msgpack jsoncpp --vcpkg-root ./submodules/vcpkg"
51+
condition: ne(variables.CACHE_RESTORED, 'true')
52+
displayName: vcpkg install dependencies
53+
54+
- template: .azure/default-build.yml
55+
parameters:
56+
agentOs: Linux
57+
jobName: Linux_Build_Test_With_CppRestSDK
58+
useCppRestSDK: true
59+
beforeBuild:
60+
- bash: "./submodules/vcpkg/bootstrap-vcpkg.sh"
61+
condition: ne(variables.CACHE_RESTORED, 'true')
62+
displayName: Bootstrap vcpkg
63+
- bash: "./submodules/vcpkg/vcpkg install cpprestsdk[websockets] boost-system boost-chrono boost-thread msgpack jsoncpp --vcpkg-root ./submodules/vcpkg"
64+
condition: ne(variables.CACHE_RESTORED, 'true')
65+
displayName: vcpkg install dependencies
66+
- bash: "sudo apt-get update && sudo apt install valgrind"
67+
displayName: install valgrind
68+
69+
- template: .azure/default-build.yml
70+
parameters:
71+
agentOs: Linux
72+
jobName: Linux_Build_Test
73+
useCppRestSDK: false
74+
beforeBuild:
75+
- bash: "./submodules/vcpkg/bootstrap-vcpkg.sh"
76+
condition: ne(variables.CACHE_RESTORED, 'true')
77+
displayName: Bootstrap vcpkg
78+
- bash: "./submodules/vcpkg/vcpkg install msgpack jsoncpp --vcpkg-root ./submodules/vcpkg"
79+
condition: ne(variables.CACHE_RESTORED, 'true')
80+
displayName: vcpkg install dependencies
81+
- bash: "sudo apt-get update && sudo apt install valgrind"
82+
displayName: install valgrind
83+
84+
- template: .azure/default-build.yml
85+
parameters:
86+
agentOs: Windows
87+
jobName: Windows_Build_Test
88+
useCppRestSDK: false
89+
cMakeRunArgs: '-A x64'
90+
beforeBuild:
91+
- powershell: "& ./submodules/vcpkg/bootstrap-vcpkg.bat"
92+
condition: ne(variables.CACHE_RESTORED, 'true')
93+
displayName: Bootstrap vcpkg
94+
- powershell: "& ./submodules/vcpkg/vcpkg.exe install msgpack:x64-windows jsoncpp:x64-windows --vcpkg-root ./submodules/vcpkg"
95+
condition: ne(variables.CACHE_RESTORED, 'true')
96+
displayName: vcpkg install dependencies
97+
98+
- template: .azure/default-build.yml
99+
parameters:
100+
agentOs: macOs
101+
jobName: Mac_Build_Test
102+
useCppRestSDK: false
103+
beforeBuild:
104+
- script: brew install gcc
105+
displayName: Install gcc
106+
- bash: "./submodules/vcpkg/bootstrap-vcpkg.sh"
107+
condition: ne(variables.CACHE_RESTORED, 'true')
108+
displayName: Bootstrap vcpkg
109+
- bash: "./submodules/vcpkg/vcpkg install msgpack jsoncpp --vcpkg-root ./submodules/vcpkg"
110+
condition: ne(variables.CACHE_RESTORED, 'true')
111+
displayName: vcpkg install dependencies

0 commit comments

Comments
 (0)