xharness/azure-pipelines.yml

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

variables:
- template: eng/common-variables.yml
- name: Build.Repository.Clean
value: true
# CI and PR triggers
trigger:
batch: true
branches:
include:
- master
pr:
branches:
include:
- master
stages:
- stage: Build_Windows_NT
displayName: Build Windows
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableTelemetry: true
enablePublishBuildArtifacts: true
enableMicrobuild: true
enablePublishUsingPipelines: true
enablePublishBuildAssets: true
helixRepo: dotnet/xharness
jobs:
- job: Windows_NT
pool:
${{ if eq(variables._RunAsInternal, True) }}:
name: NetCoreInternal-Pool
queue: BuildPool.Server.Amd64.VS2019
${{ if eq(variables._RunAsPublic, True) }}:
name: NetCorePublic-Pool
queue: BuildPool.Server.Amd64.VS2019.Open
strategy:
matrix:
Release:
_BuildConfig: Release
${{ if eq(variables._RunAsPublic, True) }}:
Debug:
_BuildConfig: Debug
steps:
- ${{ if eq(variables._RunAsPublic, False) }}:
- script: eng\common\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_InternalBuildArgs)
/p:Test=false
name: Build
displayName: Build
condition: succeeded()
- ${{ if eq(variables._RunAsPublic, True) }}:
- script: eng\common\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_InternalBuildArgs)
name: Build
displayName: Build and run tests
condition: succeeded()
- task: PublishTestResults@2
displayName: 'Publish Unit Test Results'
inputs:
testResultsFormat: xUnit
testResultsFiles: '$(Build.SourcesDirectory)/artifacts/TestResults/**/*.xml'
mergeTestResults: true
searchFolder: $(system.defaultworkingdirectory)
testRunTitle: XHarness unit tests - $(Agent.JobName)
condition: succeededOrFailed()
- ${{ if eq(variables._RunAsPublic, False) }}:
- task: ComponentGovernanceComponentDetection@0
displayName: Component Governance scan
inputs:
ignoreDirectories: '$(Build.SourcesDirectory)/.packages,$(Build.SourcesDirectory)/artifacts/obj/Microsoft.DotNet.XHarness.CLI/$(_BuildConfig)/netcoreapp3.1/android-tools-unzipped'
- ${{ if eq(variables._RunAsPublic, True) }}:
- stage: Build_OSX
displayName: Build OSX
dependsOn:
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableTelemetry: true
enablePublishBuildArtifacts: true
enableMicrobuild: true
enablePublishUsingPipelines: true
enablePublishBuildAssets: true
helixRepo: dotnet/xharness
jobs:
- job: OSX
pool:
name: Hosted macOS
strategy:
matrix:
Release:
_BuildConfig: Release
${{ if eq(variables._RunAsPublic, True) }}:
Debug:
_BuildConfig: Debug
steps:
- ${{ if eq(variables._RunAsPublic, False) }}:
- script: eng/common/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
$(_InternalBuildArgs)
/p:Test=false
name: Build
displayName: Build
condition: succeeded()
- ${{ if eq(variables._RunAsPublic, True) }}:
- script: eng/common/cibuild.sh
--configuration $(_BuildConfig)
--prepareMachine
$(_InternalBuildArgs)
name: Build
displayName: Build and run tests
condition: succeeded()
- bash: |
targetDir=$(Build.ArtifactStagingDirectory)/Microsoft.DotNet.XHarness.SimulatorInstaller.IntegrationTests.OSX.$(_BuildConfig)
mkdir $targetDir
cp tests/integration-tests/iOS/helix-payloads/simulatorinstaller-integration-tests.sh $targetDir
cp artifacts/packages/$(_BuildConfig)/Shipping/Microsoft.DotNet.XHarness.SimulatorInstaller*.nupkg $targetDir
displayName: Prepare the SimulatorInstaller IntegrationTests artifact
workingDirectory: $(Build.SourcesDirectory)
condition: and(succeeded(), eq(variables['_BuildConfig'], 'Debug'))
- publish: $(Build.ArtifactStagingDirectory)/Microsoft.DotNet.XHarness.SimulatorInstaller.IntegrationTests.OSX.$(_BuildConfig)
artifact: Microsoft.DotNet.XHarness.SimulatorInstaller.IntegrationTests.OSX.$(_BuildConfig)
displayName: Publish the SimulatorInstaller IntegrationTests artifact
condition: and(succeeded(), eq(variables['_BuildConfig'], 'Debug'))
- publish: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping/Microsoft.DotNet.XHarness.CLI.1.0.0-ci.nupkg
artifact: Microsoft.DotNet.XHarness.CLI.$(_BuildConfig)
displayName: Publish XHarness CLI for Helix Testing
condition: and(succeeded(), eq(variables['_BuildConfig'], 'Debug'))
- task: PublishTestResults@2
displayName: 'Publish Unit Test Results'
inputs:
testResultsFormat: xUnit
testResultsFiles: '$(Build.SourcesDirectory)/artifacts/TestResults/**/*.xml'
mergeTestResults: true
searchFolder: $(system.defaultworkingdirectory)
testRunTitle: XHarness unit tests - $(Agent.JobName)
condition: succeededOrFailed()
- stage: Test_CLI_Package_In_Helix_Android
displayName: 'CLI Android Integration tests (Helix SDK)'
dependsOn: Build_OSX
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
workspace:
clean: all
jobs:
- job: Linux
pool:
vmimage: ubuntu-latest
strategy:
matrix:
Build_Debug:
_BuildConfig: Debug
preSteps:
- checkout: self
clean: true
displayName: Submit Helix Job
steps:
- task: DownloadPipelineArtifact@2
inputs:
source: current
artifact: Microsoft.DotNet.XHarness.CLI.Debug
path: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping/
- script: eng/common/build.sh
--configuration $(_BuildConfig)
--prepareMachine
--ci
--restore
--test
--projects $(Build.SourcesDirectory)/tests/integration-tests/Android/Android.Helix.SDK.Tests.proj
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/Android.Helix.SDK.Tests.binlog
/p:RestoreUsingNuGetTargets=false
displayName: Run Helix Tests
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
HelixAccessToken: ''
- stage: Test_CLI_Package_In_Helix_iOS
displayName: 'CLI iOS Integration tests (Helix SDK)'
dependsOn: Build_OSX
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
workspace:
clean: all
jobs:
- job: OSX
pool:
name: Hosted macOS
strategy:
matrix:
Build_Debug:
_BuildConfig: Debug
preSteps:
- checkout: self
clean: true
displayName: Submit Helix Job
steps:
- task: DownloadPipelineArtifact@2
inputs:
source: current
artifact: Microsoft.DotNet.XHarness.CLI.Debug
path: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping/
- script: eng/common/build.sh
--configuration $(_BuildConfig)
--prepareMachine
--ci
--restore
--test
--projects $(Build.SourcesDirectory)/tests/integration-tests/iOS/iOS.Helix.SDK.Tests.proj
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/iOS.Helix.SDK.Tests.binlog
/p:RestoreUsingNuGetTargets=false
displayName: Run Helix Tests
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
HelixAccessToken: ''
- stage: Test_CLI_Package_In_Helix_WASM
displayName: 'CLI WASM Integration tests (Helix SDK)'
dependsOn: Build_OSX
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
workspace:
clean: all
jobs:
- job: OSX
pool:
name: Hosted macOS
strategy:
matrix:
Build_Debug:
_BuildConfig: Debug
preSteps:
- checkout: self
clean: true
displayName: Submit Helix Job
steps:
- task: DownloadPipelineArtifact@2
inputs:
source: current
artifact: Microsoft.DotNet.XHarness.CLI.Debug
path: $(Build.SourcesDirectory)/artifacts/packages/$(_BuildConfig)/Shipping/
- script: eng/common/build.sh
--configuration $(_BuildConfig)
--prepareMachine
--ci
--restore
--test
--projects $(Build.SourcesDirectory)/tests/integration-tests/WASM/WASM.Helix.SDK.Tests.proj
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/WASM.Helix.SDK.Tests.binlog
/p:RestoreUsingNuGetTargets=false
displayName: Run Helix Tests
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
HelixAccessToken: ''
- stage: Test_SimulatorInstaller
displayName: SimulatorInstaller Integration Tests
dependsOn: Build_OSX
jobs:
- job: integration_tests
displayName: SimulatorInstaller Integration Tests
pool:
name: Hosted macOS
variables:
_BuildConfig: debug
steps:
- download: current
artifact: Microsoft.DotNet.XHarness.SimulatorInstaller.IntegrationTests.OSX.Debug
- template: /eng/common/templates/steps/send-to-helix.yml
parameters:
DisplayNamePrefix: Run Tests
HelixBaseUri: https://helix.dot.net/
HelixType: test/product/
IncludeDotNetCli: true
DotNetCliPackageType: sdk
DotNetCliVersion: 3.1.201
WaitForWorkItemCompletion: true
HelixTargetQueues: osx.1015.amd64.open
Creator: xharness
EnableXUnitReporter: false
WorkItemDirectory: $(Pipeline.Workspace)/Microsoft.DotNet.XHarness.SimulatorInstaller.IntegrationTests.OSX.Debug
WorkItemCommand: sudo ./simulatorinstaller-integration-tests.sh
WorkItemTimeout: 00:05:00
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
HelixAccessToken: ''
- ${{ if eq(variables._RunAsInternal, True) }}:
- template: eng\common\templates\post-build\post-build.yml
parameters:
publishingInfraVersion: 3
enableSymbolValidation: true
# Reenable once this issue is resolved: https://github.com/dotnet/arcade/issues/2912
enableSourceLinkValidation: false
validateDependsOn:
- Build_Windows_NT
publishDependsOn:
- Validate
# This is to enable SDL runs part of Post-Build Validation Stage
SDLValidationParameters:
enable: false
continueOnError: false
params: ' -SourceToolsList @("policheck","credscan")
-TsaInstanceURL $(_TsaInstanceURL)
-TsaProjectName $(_TsaProjectName)
-TsaNotificationEmail $(_TsaNotificationEmail)
-TsaCodebaseAdmin $(_TsaCodebaseAdmin)
-TsaBugAreaPath $(_TsaBugAreaPath)
-TsaIterationPath $(_TsaIterationPath)
-TsaRepositoryName "Arcade"
-TsaCodebaseName "Arcade"
-TsaPublish $True'