123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518 |
- parameters:
- # Agent OS identifier and used as job name
- agentOs: ''
- # Agent pool
- pool: {}
- # Additional variables
- variables: {}
- # Build strategy - matrix
- strategy: ''
- # Job timeout
- timeoutInMinutes: 180
- jobs:
- - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest'), eq(variables['Build.SourceBranch'], 'refs/heads/release/8.0.3xx'), not(contains(parameters.agentOs, 'TemplateEngine'))) }}:
- - template: /eng/common/templates-official/job/onelocbuild.yml@self
- parameters:
- CreatePr: true
- LclSource: lclFilesfromPackage
- LclPackageId: 'LCL-JUNO-PROD-DOTNETSDK'
- MirrorBranch: release/8.0.4xx
- MirrorRepo: sdk
- - ${{ if not(contains(parameters.agentOs, 'TemplateEngine')) }}:
- - template: /eng/common/templates-official/job/job.yml@self
- parameters:
- name: ${{ parameters.agentOs }}
- enableMicrobuild: true
- enablePublishBuildAssets: true
- enableTelemetry: true
- enablePublishUsingPipelines: true
- helixRepo: dotnet/sdk
- pool: ${{ parameters.pool }}
- timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
- ${{ if ne(parameters.strategy, '') }}:
- strategy: ${{ parameters.strategy }}
- workspace:
- clean: all
- variables:
- - ${{ each variable in parameters.variables }}:
- - ${{ if ne(variable.name, '') }}:
- - name: ${{ variable.name }}
- value: ${{ variable.value }}
- - name: _AgentOSName
- value: ${{ parameters.agentOs }}
- - name: _TeamName
- value: DotNetCore
- - name: _OfficialBuildIdArgs
- value: ''
- - name: _SignArgs
- value: ''
- - name: _HelixApiToken
- value: ''
- # Helix Testing requires a token when internally run
- - ${{ if ne(variables['System.TeamProject'], 'public') }}:
- - group: DotNet-HelixApi-Access
- - name: _HelixApiToken
- value: $(HelixApiAccessToken)
- - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- - group: dotnet-benchview
- - name: _OfficialBuildIdArgs
- value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
- - name: _SignArgs
- value: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
- - name: _PerfIterations
- value: 25
- steps:
- - ${{ if ne(variables['System.TeamProject'], 'public') }}:
- - task: PowerShell@2
- displayName: Setup Private Feeds Credentials
- inputs:
- filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
- arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
- env:
- Token: $(dn-bot-dnceng-artifact-feeds-rw)
- - ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- - powershell: eng\common\build.ps1
- $(_CIBuild)
- -configuration $(_BuildConfig)
- -nativeToolsOnMachine
- $(_PublishArgs)
- $(_SignArgs)
- $(_OfficialBuildIdArgs)
- /p:Test=false
- $(_InternalRuntimeDownloadArgs)
- $(_OfficialBuildArgs)
- continueOnError: false
- displayName: Build
- env:
- BuildConfig: $(_BuildConfig)
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- HelixAccessToken: ${{ parameters.HelixAccessToken }}
- - powershell: eng\common\build.ps1
- -configuration $(_BuildConfig)
- -nativeToolsOnMachine
- -prepareMachine
- -ci
- -restore
- $(_Test)
- -projects $(Build.SourcesDirectory)\test\UnitTests.proj
- /bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\TestInHelix.binlog
- /p:_CustomHelixTargetQueue=${{ parameters.helixTargetQueue }}
- $(_InternalRuntimeDownloadArgs)
- displayName: Run Tests in Helix
- condition: succeeded()
- env:
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- HelixAccessToken: $(_HelixApiToken)
- RunAoTTests: 'false'
- - ${{ if eq(parameters.agentOs, 'Windows_NT_FullFramework') }}:
- - powershell: eng\common\build.ps1
- $(_CIBuild)
- -configuration $(_BuildConfig)
- -nativeToolsOnMachine
- $(_SignArgs)
- $(_OfficialBuildIdArgs)
- $(_InternalRuntimeDownloadArgs)
- /p:Test=false
- continueOnError: false
- displayName: Build
- env:
- BuildConfig: $(_BuildConfig)
- TestFullMSBuild: 'true'
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- HelixAccessToken: ${{ parameters.HelixAccessToken }}
- - powershell: eng\common\build.ps1
- -configuration $(_BuildConfig)
- -nativeToolsOnMachine
- -prepareMachine
- -ci
- -restore
- -test
- -projects $(Build.SourcesDirectory)\test\UnitTests.proj
- /bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\TestInHelix.binlog
- /p:_CustomHelixTargetQueue=${{ parameters.helixTargetQueue }}
- $(_InternalRuntimeDownloadArgs)
- displayName: Run Tests in Helix
- condition: succeededOrFailed()
- env:
- TestFullMSBuild: 'true'
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- HelixAccessToken: $(_HelixApiToken)
- - ${{ if eq(parameters.agentOs, 'Windows_NT_TestAsTools') }}:
- - powershell: eng\common\build.ps1
- $(_CIBuild)
- -configuration $(_BuildConfig)
- -nativeToolsOnMachine
- $(_SignArgs)
- $(_OfficialBuildIdArgs)
- $(_InternalRuntimeDownloadArgs)
- /p:RunTestsAsTool=true
- displayName: Build
- env:
- BuildConfig: $(_BuildConfig)
- - ${{ if notIn(parameters.agentOs, 'Windows_NT', 'Windows_NT_FullFramework', 'Windows_NT_TestAsTools') }}:
- - script: eng/common/build.sh
- $(_CIBuild)
- --configuration $(_BuildConfig)
- $(_SignArgs)
- $(_OfficialBuildIdArgs)
- $(_InternalRuntimeDownloadArgs)
- -p:Test=false
- continueOnError: false
- displayName: Build
- env:
- BuildConfig: $(_BuildConfig)
- - powershell: eng/common/build.sh
- -configuration $(_BuildConfig)
- -prepareMachine
- -ci
- -restore
- -test
- -projects $(Build.SourcesDirectory)/test/UnitTests.proj
- /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/TestInHelix.binlog
- /p:_CustomHelixTargetQueue=${{ parameters.helixTargetQueue }}
- $(_InternalRuntimeDownloadArgs)
- displayName: Run Tests in Helix
- condition: succeededOrFailed()
- env:
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- HelixAccessToken: $(_HelixApiToken)
- RunAoTTests: 'false'
- - task: CopyFiles@2
- displayName: Gather Logs
- inputs:
- SourceFolder: '$(Build.SourcesDirectory)/artifacts'
- Contents: |
- log/$(_BuildConfig)/**/*
- TestResults/$(_BuildConfig)/**/*
- SymStore/$(_BuildConfig)/**/*
- tmp/$(_BuildConfig)/**/*.binlog
- TargetFolder: '$(Build.ArtifactStagingDirectory)'
- continueOnError: true
- condition: always()
- - task: 1ES.PublishBuildArtifacts@1
- displayName: Publish Logs to VSTS
- inputs:
- PathtoPublish: '$(Build.ArtifactStagingDirectory)'
- ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)'
- publishLocation: Container
- continueOnError: true
- condition: always()
- # AoT Jobs
- - ${{ if and(in(parameters.agentOs, 'Windows_NT', 'Darwin'), or(eq(variables['System.TeamProject'], 'public'), in(variables['Build.Reason'], 'PullRequest'))) }}:
- - template: /eng/common/templates-official/job/job.yml@self
- parameters:
- name: ${{ parameters.agentOs }}_AoT_Tests
- enableMicrobuild: true
- enablePublishBuildAssets: true
- enableTelemetry: true
- enablePublishUsingPipelines: true
- helixRepo: dotnet/sdk
- pool: ${{ parameters.pool }}
- timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
- ${{ if ne(parameters.strategy, '') }}:
- strategy: ${{ parameters.strategy }}
- workspace:
- clean: all
- variables:
- - ${{ each variable in parameters.variables }}:
- - ${{ if ne(variable.name, '') }}:
- - name: ${{ variable.name }}
- value: ${{ variable.value }}
- - name: _AgentOSName
- value: ${{ parameters.agentOs }}
- - name: _TeamName
- value: DotNetCore
- - name: _OfficialBuildIdArgs
- value: ''
- - name: _PublishArgs
- value: ''
- - name: _SignArgs
- value: ''
- - name: _HelixApiToken
- value: ''
- # Helix Testing requires a token when internally run
- - ${{ if ne(variables['System.TeamProject'], 'public') }}:
- - group: DotNet-HelixApi-Access
- - name: _HelixApiToken
- value: $(HelixApiAccessToken)
- - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- - group: dotnet-benchview
- - name: _OfficialBuildIdArgs
- value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
- - name: _SignArgs
- value: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
- - name: _PerfIterations
- value: 25
- steps:
- - ${{ if and(ne(variables['System.TeamProject'], 'public'), in(parameters.agentOs, 'Windows_NT', 'Darwin')) }}:
- - task: PowerShell@2
- displayName: Setup Private Feeds Credentials
- inputs:
- filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
- arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
- env:
- Token: $(dn-bot-dnceng-artifact-feeds-rw)
- - ${{ if eq(parameters.agentOs, 'Windows_NT') }}:
- - powershell: eng\common\build.ps1
- $(_CIBuild)
- -configuration $(_BuildConfig)
- -nativeToolsOnMachine
- $(_SignArgs)
- $(_OfficialBuildIdArgs)
- /p:Test=false
- $(_InternalRuntimeDownloadArgs)
- continueOnError: false
- displayName: Build
- env:
- BuildConfig: $(_BuildConfig)
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- HelixAccessToken: ${{ parameters.HelixAccessToken }}
- - script: $(Build.SourcesDirectory)/artifacts/bin/redist/$(_BuildConfig)/dotnet/dotnet workload install wasm-tools --skip-manifest-update
- displayName: Install wasm-tools Workload
- continueOnError: false
- - powershell: $(Build.SourcesDirectory)/eng/common/build.ps1
- -ci
- -restore
- -test
- -prepareMachine
- -projects $(Build.SourcesDirectory)/test/UnitTests.proj
- -configuration $(_BuildConfig)
- -nativeToolsOnMachine
- /bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\TestInHelix.binlog
- /p:_CustomHelixTargetQueue=${{ parameters.helixTargetQueue }}
- $(_InternalRuntimeDownloadArgs)
- displayName: Run AoT Tests in Helix
- env:
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- HelixAccessToken: $(_HelixApiToken)
- RunAoTTests: 'true'
- - ${{ if eq(parameters.agentOs, 'Darwin') }}:
- - script: eng/common/build.sh
- --configuration $(_BuildConfig)
- --restore
- --build
- --pack
- --ci
- $(_SignArgs)
- $(_OfficialBuildIdArgs)
- $(_InternalRuntimeDownloadArgs)
- -p:Test=false
- displayName: Build
- env:
- BuildConfig: $(_BuildConfig)
- - script: $(Build.SourcesDirectory)/artifacts/bin/redist/$(_BuildConfig)/dotnet/dotnet workload install wasm-tools --skip-manifest-update
- displayName: Install wasm-tools Workload
- continueOnError: false
- - script: eng/common/build.sh
- --configuration $(_BuildConfig)
- --prepareMachine
- --ci
- --restore
- --test
- --projects $(Build.SourcesDirectory)/test/UnitTests.proj
- /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/TestInHelix.binlog
- /p:_CustomHelixTargetQueue=${{ parameters.helixTargetQueue }}
- $(_InternalRuntimeDownloadArgs)
- displayName: Run AoT Tests in Helix
- env:
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- HelixAccessToken: $(_HelixApiToken)
- RunAoTTests: 'true'
- - ${{ if in(parameters.agentOs, 'Windows_NT', 'Darwin') }}:
- - task: CopyFiles@2
- displayName: Gather Logs
- inputs:
- SourceFolder: '$(Build.SourcesDirectory)/artifacts'
- Contents: |
- log/$(_BuildConfig)/**/*
- TestResults/$(_BuildConfig)/**/*
- SymStore/$(_BuildConfig)/**/*
- tmp/$(_BuildConfig)/**/*.binlog
- TargetFolder: '$(Build.ArtifactStagingDirectory)'
- continueOnError: true
- condition: always()
- - task: 1ES.PublishBuildArtifacts@1
- displayName: Publish Logs to VSTS
- inputs:
- PathtoPublish: '$(Build.ArtifactStagingDirectory)'
- ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)'
- publishLocation: Container
- continueOnError: true
- condition: always()
- # TemplateEngine Jobs
- - ${{ if contains(parameters.agentOs, 'TemplateEngine') }}:
- - template: /eng/common/templates-official/job/job.yml@self
- parameters:
- name: ${{ parameters.agentOs }}
- enableMicrobuild: true
- enablePublishBuildAssets: true
- enableTelemetry: true
- enablePublishUsingPipelines: true
- helixRepo: dotnet/sdk
- pool: ${{ parameters.pool }}
- timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
- ${{ if ne(parameters.strategy, '') }}:
- strategy: ${{ parameters.strategy }}
- workspace:
- clean: all
- variables:
- - ${{ each variable in parameters.variables }}:
- - ${{ if ne(variable.name, '') }}:
- - name: ${{ variable.name }}
- value: ${{ variable.value }}
- - name: _AgentOSName
- value: ${{ parameters.agentOs }}
- - name: _TeamName
- value: DotNetCore
- - name: _OfficialBuildIdArgs
- value: ''
- - name: _PublishArgs
- value: ''
- - name: _SignArgs
- value: ''
- - name: _HelixApiToken
- value: ''
- # Helix Testing requires a token when internally run
- - ${{ if ne(variables['System.TeamProject'], 'public') }}:
- - group: DotNet-HelixApi-Access
- - name: _HelixApiToken
- value: $(HelixApiAccessToken)
- - ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}:
- - group: dotnet-benchview
- - name: _OfficialBuildIdArgs
- value: /p:OfficialBuildId=$(BUILD.BUILDNUMBER)
- - name: _SignArgs
- value: /p:DotNetSignType=$(_SignType) /p:TeamName=$(_TeamName)
- - name: _PerfIterations
- value: 25
- steps:
- - ${{ if ne(variables['System.TeamProject'], 'public') }}:
- - task: PowerShell@2
- displayName: Setup Private Feeds Credentials
- inputs:
- filePath: $(Build.SourcesDirectory)/eng/common/SetupNugetSources.ps1
- arguments: -ConfigFile $(Build.SourcesDirectory)/NuGet.config -Password $Env:Token
- env:
- Token: $(dn-bot-dnceng-artifact-feeds-rw)
- - ${{ if contains(parameters.agentOs, 'Windows_NT') }}:
- - powershell: eng\common\build.ps1
- $(_CIBuild)
- -configuration $(_BuildConfig)
- -nativeToolsOnMachine
- $(_SignArgs)
- $(_OfficialBuildIdArgs)
- /p:Test=false
- $(_InternalRuntimeDownloadArgs)
- displayName: Build
- env:
- BuildConfig: $(_BuildConfig)
- SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- HelixAccessToken: ${{ parameters.HelixAccessToken }}
- - powershell: eng\common\build.ps1
- -configuration $(_BuildConfig)
- -nativeToolsOnMachine
- -prepareMachine
- -ci
- -restore
- $(_Test)
- -projects $(Build.SourcesDirectory)\test\Microsoft.TemplateEngine.Cli.UnitTests\Microsoft.TemplateEngine.Cli.UnitTests.csproj
- /bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\TemplateEngine.Cli.UnitTests.binlog
- $(_InternalRuntimeDownloadArgs)
- displayName: Run TemplateEngine Cli Unit Tests
- - powershell: eng\common\build.ps1
- -configuration $(_BuildConfig)
- -nativeToolsOnMachine
- -prepareMachine
- -ci
- -restore
- $(_Test)
- -projects $(Build.SourcesDirectory)\test\dotnet-new.Tests\dotnet-new.IntegrationTests.csproj
- /bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\dotnet-new.IntegrationTests.binlog
- $(_InternalRuntimeDownloadArgs)
- displayName: Run dotnet new Integration Tests
- - ${{ if not(contains(parameters.agentOs, 'Windows_NT')) }}:
- - script: eng/common/build.sh
- --configuration $(_BuildConfig)
- --restore
- --build
- --ci
- $(_SignArgs)
- $(_OfficialBuildIdArgs)
- $(_InternalRuntimeDownloadArgs)
- -p:Test=false
- displayName: Build
- env:
- BuildConfig: $(_BuildConfig)
- - powershell: eng/common/build.sh
- -configuration $(_BuildConfig)
- -prepareMachine
- -ci
- -restore
- -test
- -projects $(Build.SourcesDirectory)/test/Microsoft.TemplateEngine.Cli.UnitTests/Microsoft.TemplateEngine.Cli.UnitTests.csproj
- /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/TemplateEngine.Cli.UnitTests.binlog
- $(_InternalRuntimeDownloadArgs)
- displayName: Run TemplateEngine Cli Unit Tests
- - powershell: eng/common/build.sh
- -configuration $(_BuildConfig)
- -prepareMachine
- -ci
- -restore
- -test
- -projects $(Build.SourcesDirectory)/test/dotnet-new.Tests/dotnet-new.IntegrationTests.csproj
- /bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/dotnet-new.IntegrationTests.binlog
- $(_InternalRuntimeDownloadArgs)
- displayName: Run dotnet new Integration Tests
- - task: PublishTestResults@2
- displayName: Publish Test Results
- inputs:
- testResultsFormat: xUnit
- testResultsFiles: 'artifacts/TestResults/$(_BuildConfig)/*.xml'
- testRunTitle: '$(_AgentOSName)_$(Agent.JobName)'
- buildPlatform: '$(BuildPlatform)'
- buildConfiguration: '$(_BuildConfig)'
- condition: always()
- - task: CopyFiles@2
- displayName: Gather Logs
- inputs:
- SourceFolder: '$(Build.SourcesDirectory)/artifacts'
- Contents: |
- log/$(_BuildConfig)/**/*
- TestResults/$(_BuildConfig)/**/*
- SymStore/$(_BuildConfig)/**/*
- tmp/$(_BuildConfig)/**/*.binlog
- TargetFolder: '$(Build.ArtifactStagingDirectory)'
- continueOnError: true
- condition: always()
- - task: 1ES.PublishBuildArtifacts@1
- displayName: Publish Logs to VSTS
- inputs:
- PathtoPublish: '$(Build.ArtifactStagingDirectory)'
- ArtifactName: '$(_AgentOSName)_$(Agent.JobName)_$(Build.BuildNumber)'
- publishLocation: Container
- continueOnError: true
- condition: always()
|