-
Notifications
You must be signed in to change notification settings - Fork 177
/
ci.yml
143 lines (135 loc) · 5.72 KB
/
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
# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file.
trigger:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
paths:
include:
- tools/apiview/parsers/cpp-api-parser
pr:
branches:
include:
- main
- feature/*
- release/*
- hotfix/*
paths:
include:
- tools/apiview/parsers/cpp-api-parser
variables:
- template: /eng/pipelines/templates/variables/image.yml
- template: /eng/pipelines/templates/variables/globals.yml
- name: VcpkgRelease
value: '2024.08.23'
resources:
repositories:
- repository: azure-sdk-build-tools
type: git
name: internal/azure-sdk-build-tools
ref: refs/tags/azure-sdk-build-tools_20241025.1
stages:
- stage: 'Build'
jobs:
- job: 'Build'
timeoutInMinutes: 300
pool:
name: $(WINDOWSPOOL)
image: $(WINDOWSVMIMAGE)
os: windows
steps:
- pwsh: |
Write-Host "git clone https://github.com/Microsoft/vcpkg"
git clone https://github.com/Microsoft/vcpkg
if ($LASTEXITCODE -ne 0) {
Write-Error "Unable to check out vcpkg fork repo"
exit $LASTEXITCODE
}
cd ./vcpkg
git fetch --tags
git checkout $(VcpkgRelease)
displayName: Clone vcpkg
workingDirectory: '$(Build.SourcesDirectory)'
- pwsh: |
./vcpkg/bootstrap-vcpkg
displayName: Bootstrap vcpkg.
condition: succeeded()
workingDirectory: '$(Build.SourcesDirectory)'
- pwsh: |
$vcpkgRoot = Resolve-Path "./vcpkg"
Write-Host "Set VCPKG_ROOT: $vcpkgRoot"
Write-Host "##vso[task.setvariable variable=VCPKG_ROOT]$vcpkgRoot"
displayName: Set VCPKG_ROOT
condition: succeeded()
- pwsh: mkdir build
displayName: Create cmake build directory.
workingDirectory: '$(Build.SourcesDirectory)/tools/apiview/parsers/cpp-api-parser'
condition: succeeded()
- task: AzurePowerShell@5
displayName: Set Vcpkg Write-mode Cache
inputs:
azureSubscription: 'Azure SDK Artifacts'
ScriptType: FilePath
ScriptPath: eng/scripts/Set-VcpkgWriteModeCache.ps1
azurePowerShellVersion: LatestVersion
pwsh: true
# This step is idempotent and can be run multiple times in cases of
# failure and partial execution.
retryCountOnTaskFailure: 3
- pwsh: |
cmake.exe -G "Visual Studio 17 2022" -DCMAKE_CXX_STANDARD:STRING="20" -DCMAKE_TOOLCHAIN_FILE:STRING=${env:VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake -DVCPKG_BUILD_TYPE:STRING="release" -DVCPKG_OVERLAY_TRIPLETS:STRING="../vcpkg-triplets" -DMSVC_RUNTIME_LIBRARY:STRING="MultiThreadedDebug" -DVCPKG_TARGET_TRIPLET:STRING="x64-windows-static-release" ..
displayName: Cmake Generate.
workingDirectory: $(Build.SourcesDirectory)/tools/apiview/parsers/cpp-api-parser/build
condition: succeeded()
env:
VCPKG_BINARY_SOURCES: $(VCPKG_BINARY_SOURCES_SECRET)
- pwsh: |
cmake.exe --build . --parallel 8 --target ParseAzureSdkCpp --config RelWithDebInfo
workingDirectory: $(Build.SourcesDirectory)/tools/apiview/parsers/cpp-api-parser/build
displayName: Build ApiView Parser.
- pwsh: |
cmake.exe --build . --parallel 8 --target parseTests --config RelWithDebInfo
workingDirectory: $(Build.SourcesDirectory)/tools/apiview/parsers/cpp-api-parser/build
displayName: Build ApiView Tests.
- pwsh: |
RelWithDebInfo/parseTests
workingDirectory: $(Build.SourcesDirectory)/tools/apiview/parsers/cpp-api-parser/build/parseTests
displayName: Run ApiView Tests.
- pwsh: Get-ChildItem -Recurse
workingDirectory: $(Build.SourcesDirectory)/tools/apiview/parsers/cpp-api-parser/build/ParseAzureSdkCpp
- task: PublishPipelineArtifact@1
inputs:
artifactName: release-artifacts
path: $(Build.SourcesDirectory)/tools/apiview/parsers/cpp-api-parser/build/ParseAzureSdkCpp
- ${{if and(eq(variables['Build.Reason'], 'Manual'), eq(variables['System.TeamProject'], 'internal'))}}:
- stage: 'Release'
dependsOn: Build
jobs:
- deployment: Release
# Use GitHub environment as it's used for other C++ releases
environment: github
pool:
name: azsdk-pool-mms-win-2022-general
vmImage: windows-2022
strategy:
runOnce:
deploy:
steps:
- download: current
artifact: release-artifacts
- template: pipelines/steps/binary-signing.yml@azure-sdk-build-tools
parameters:
BinaryPath: $(Pipeline.Workspace)/release-artifacts
- task: AzurePowerShell@5
displayName: Publish Public ApiView Parser
inputs:
azureSubscription: 'Azure SDK Artifacts'
ScriptType: 'InlineScript'
azurePowerShellVersion: LatestVersion
pwsh: true
Inline: |
azcopy copy "$(Pipeline.Workspace)/release-artifacts/*" "https://azuresdkartifacts.blob.core.windows.net/azure-sdk-for-cpp/parseazuresdkcpp/$(OfficialBuildId)" --recursive
env:
AZCOPY_AUTO_LOGIN_TYPE: 'PSCRED'