try/azure-pipelines.yml

153 строки
6.3 KiB
YAML
Исходник Обычный вид История

# azure-pipelines.yml
parameters:
- name: SkipTests
displayName: Skip Tests
type: boolean
default: false
2019-05-14 01:52:48 +03:00
# CI and PR triggers
trigger:
2020-08-19 22:07:52 +03:00
- main
2019-05-31 00:30:46 +03:00
- feature/*
2022-04-02 00:35:20 +03:00
- release/*
2019-05-14 01:52:48 +03:00
pr:
2020-08-19 22:07:52 +03:00
- main
2019-05-31 00:30:46 +03:00
- feature/*
2022-04-02 00:35:20 +03:00
- release/*
2019-05-14 01:52:48 +03:00
variables:
2024-04-19 23:33:36 +03:00
- template: /eng/templates/variables-template.yml@self
- name: system.debug
value: true
- name: additionalWindowsArgs
value: '--diag $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/diag.txt -p:m=1'
- name: additionalLinuxArgs
value: '--diag $(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)/diag.txt'
2019-05-14 01:52:48 +03:00
stages:
- stage: build
displayName: Build and Test
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: true
2020-10-09 00:28:55 +03:00
enablePublishBuildAssets: true
enablePublishUsingPipelines: $(_PublishUsingPipelines)
jobs:
- job: Windows_NT
pool:
${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
2022-09-02 00:29:09 +03:00
name: NetCore-Public
demands: ImageOverride -equals windows.vs2022.amd64.open
${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
2021-09-30 00:19:44 +03:00
name: NetCore1ESPool-Internal
2022-07-21 20:04:16 +03:00
demands: ImageOverride -equals windows.vs2022.amd64
variables:
- name: RunIntegrationTests
value: true
- name: TRYDOTNET_PREBUILDS_PATH
value: $(Build.SourcesDirectory)\artifacts\trydotnet-prebuilds
- name: POCKETLOGGER_LOG_PATH
value: $(Build.SourcesDirectory)\artifacts\logs\pocketlogger.log
# Enable signing for internal, non-PR builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
2019-10-09 01:53:21 +03:00
- group: DotNet-Symbol-Server-Pats
- name: _SignType
value: Real
2020-10-09 00:28:55 +03:00
- name: _DotNetPublishToBlobFeed
value: false
- name: _BuildArgs
value: /p:SignType=$(_SignType)
2019-10-09 01:53:21 +03:00
/p:DotNetSignType=$(_SignType)
/p:MicroBuild_SigningEnabled=true
/p:OverridePackageSource=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:TeamName=$(_TeamName)
/p:DotNetPublishToBlobFeed=false
2019-10-09 01:53:21 +03:00
/p:DotNetPublishUsingPipelines=$(_PublishUsingPipelines)
/p:DotNetArtifactsCategory=$(_DotNetArtifactsCategory)
/p:DotNetSymbolServerTokenMsdl=$(microsoft-symbol-server-pat)
/p:DotNetSymbolServerTokenSymWeb=$(symweb-symbol-server-pat)
2020-10-09 00:28:55 +03:00
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
# else
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- name: _SignType
value: Test
- name: _BuildArgs
value: /p:SignType=$(_SignType)
steps:
2024-04-19 23:33:36 +03:00
- template: /eng/templates/build-and-test-job-windows-templates.yml@self
parameters:
buildConfig: $(_BuildConfig)
skipTests: $(SkipTests)
buildArgs: $(_BuildArgs)
additionalArgs: $(additionalWindowsArgs)
2024-04-19 23:33:36 +03:00
- task: PublishBuildArtifacts@1
displayName: Publish Windows artifacts
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/
artifactName: Windows_artifacts
artifactType: container
condition: always()
2020-01-09 21:10:07 +03:00
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: true
2020-01-09 21:10:07 +03:00
enablePublishBuildAssets: false
2020-10-09 00:28:55 +03:00
enablePublishUsingPipelines: false
jobs:
- job: Linux
pool:
vmImage: ubuntu-20.04
variables:
- name: TRYDOTNET_PREBUILDS_PATH
value: $(Build.SourcesDirectory)/artifacts/trydotnet-prebuilds
- name: POCKETLOGGER_LOG_PATH
value: $(Build.SourcesDirectory)/artifacts/logs/pocketlogger.log
# Enable signing for internal, non-PR builds
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- name: _SignType
value: Test
- name: _BuildArgs
value: /p:SignType=$(_SignType)
/p:DotNetSignType=$(_SignType)
/p:OverridePackageSource=https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json
/p:TeamName=$(_TeamName)
/p:OfficialBuildId=$(BUILD.BUILDNUMBER)
# else
- ${{ if or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest')) }}:
- name: _SignType
value: Test
- name: _BuildArgs
value: /p:SignType=$(_SignType)
steps:
2024-04-19 23:33:36 +03:00
- template: /eng/templates/build-and-test-job-linux-templates.yml@self
parameters:
buildConfig: $(_BuildConfig)
skipTests: $(SkipTests)
additionalArgs: $(additionalLinuxArgs)
2024-04-19 23:33:36 +03:00
- task: PublishBuildArtifacts@1
displayName: Publish Linux artifacts
inputs:
pathToPublish: $(Build.SourcesDirectory)/artifacts/
artifactName: Linux_artifacts
artifactType: container
condition: always()
2020-10-09 00:28:55 +03:00
#---------------------------------------------------------------------------------------------------------------------#
# Post Build #
#---------------------------------------------------------------------------------------------------------------------#
- ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- template: eng/common/templates/post-build/post-build.yml
parameters:
publishingInfraVersion: 3
2020-10-09 00:28:55 +03:00
# Symbol validation is not entirely reliable as of yet, so should be turned off until https://github.com/dotnet/arcade/issues/2871 is resolved.
enableSymbolValidation: false
# SourceLink improperly looks for generated files. See https://github.com/dotnet/arcade/issues/3069
enableSourceLinkValidation: false