SignalR-Client-Cpp/azure-pipelines.yml

143 строки
5.4 KiB
YAML

variables:
# used for SDL and arcade
- name: _TeamName
value: AspNetCore
- name: _DotNetPublishToBlobFeed
value: true
- name: DOTNET_SKIP_FIRST_TIME_EXPERIENCE
value: true
- name: _PublishUsingPipelines
value: true
- name: _DotNetArtifactsCategory
value: SIGNALR_CPP
- name: _DotNetValidationArtifactsCategory
value: SIGNALR_CPP
- name: Build.Repository.Clean
value: true
- name: _BuildConfig
value: 'Debug'
# used for post-build phases, internal builds only
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- group: DotNet-AspNet-SDLValidation-Params
trigger:
- main
stages:
- stage: build
displayName: Build
jobs:
- template: .azure/default-build.yml
parameters:
agentOs: Windows
jobName: Windows_Build_Test_With_CppRestSDK
useCppRestSDK: true
cMakeRunArgs: '-A x64'
beforeBuild:
- powershell: "& ./submodules/vcpkg/bootstrap-vcpkg.bat"
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: Bootstrap vcpkg
- powershell: "& ./submodules/vcpkg/vcpkg.exe install cpprestsdk:x64-windows --vcpkg-root ./submodules/vcpkg"
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: vcpkg install dependencies
afterBuild:
# Create empty build manifest for Build Asset Registry
- powershell: "eng/common/sdk-task.ps1 -restore -task GenerateBuildManifest /p:PackagesToPublishPattern=$(Build.ArtifactStagingDirectory)/*.nupkg /p:AssetManifestFilePath=$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/AssetManifest/manifest.xml /p:ManifestBuildData=\"Location=https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json\""
displayName: Generate Build Manifest
condition: eq(and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')), 'true')
- template: .azure/default-build.yml
parameters:
agentOs: macOs
jobName: Mac_Build_Test_With_CppRestSDK
useCppRestSDK: true
beforeBuild:
- script: brew install gcc
displayName: Install gcc
- bash: "./submodules/vcpkg/bootstrap-vcpkg.sh"
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: Bootstrap vcpkg
- bash: "./submodules/vcpkg/vcpkg install cpprestsdk"
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: vcpkg install dependencies
- template: .azure/default-build.yml
parameters:
agentOs: Linux
jobName: Linux_Build_Test_With_CppRestSDK
useCppRestSDK: true
beforeBuild:
- bash: "./submodules/vcpkg/bootstrap-vcpkg.sh"
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: Bootstrap vcpkg
- bash: "./submodules/vcpkg/vcpkg install cpprestsdk boost-system boost-chrono boost-thread --vcpkg-root ./submodules/vcpkg"
condition: ne(variables.CACHE_RESTORED, 'true')
displayName: vcpkg install dependencies
- bash: "sudo apt install valgrind"
displayName: install valgrind
- template: .azure/default-build.yml
parameters:
agentOs: Linux
jobName: Linux_Build_Test
useCppRestSDK: false
beforeBuild:
- bash: "sudo apt install valgrind"
displayName: install valgrind
- template: .azure/default-build.yml
parameters:
agentOs: Windows
jobName: Windows_Build_Test
useCppRestSDK: false
cMakeRunArgs: '-A x64 -DCMAKE_CXX_FLAGS="/fsanitize=address"'
configuration: 'RelWithDebInfo'
- template: .azure/default-build.yml
parameters:
agentOs: macOs
jobName: Mac_Build_Test
useCppRestSDK: false
beforeBuild:
- script: brew install gcc
displayName: Install gcc
# Publish to the BAR
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: /eng/common/templates/job/publish-build-assets.yml
parameters:
dependsOn:
- Windows_Build_Test_With_CppRestSDK
- Mac_Build_Test_With_CppRestSDK
- Linux_Build_Test_With_CppRestSDK
- Windows_Build_Test
- Mac_Build_Test
- Linux_Build_Test
pool:
vmImage: vs2017-win2016
publishUsingPipelines: ${{ variables._PublishUsingPipelines }}
enablePublishBuildArtifacts: true # publish artifacts/log files
continueOnError: true
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: /eng/common/templates/post-build/post-build.yml
parameters:
enableSigningValidation: false
enableNugetValidation: false
publishInstallersAndChecksums: false
# This is to enable SDL runs as part of Post-Build Validation Stage
SDLValidationParameters:
enable: true
continueOnError: false
params: ' -SourceToolsList @("policheck","credscan")
-TsaInstanceURL $(_TsaInstanceURL)
-TsaProjectName $(_TsaProjectName)
-TsaNotificationEmail $(_TsaNotificationEmail)
-TsaCodebaseAdmin $(_TsaCodebaseAdmin)
-TsaBugAreaPath $(_TsaBugAreaPath)
-TsaIterationPath $(_TsaIterationPath)
-TsaRepositoryName "AspNetCore"
-TsaCodebaseName "AspNetCore"
-TsaPublish $True
-PoliCheckAdditionalRunConfigParams @("UserExclusionPath < $(Build.SourcesDirectory)/eng/PoliCheckExclusions.xml")'