Uno.UITest/.vsts-ci.yml

221 строка
5.7 KiB
YAML

trigger:
branches:
include:
- master
- beta
- release/beta/*
- stable
- release/stable/*
pr:
branches:
include:
- master
- beta
- release/beta/*
- stable
- release/stable/*
resources:
containers:
- container: nv-bionic-wasm
image: unoplatform/wasm-build:3.0
jobs:
- job: Windows
pool:
vmImage: 'windows-2022'
variables:
NUGET_PACKAGES: $(Agent.WorkFolder)\.nuget
steps:
- checkout: self
clean: true
- task: gitversion/setup@0
retryCountOnTaskFailure: 3
inputs:
versionSpec: '5.10.3'
- task: gitversion/execute@0
retryCountOnTaskFailure: 3
inputs:
useConfigFile: true
configFilePath: gitversion.yml
displayName: Use GitVersion
- task: UseDotNet@2
displayName: 'Use .NET SDK'
retryCountOnTaskFailure: 3
inputs:
packageType: sdk
version: 7.0.302
- task: MSBuild@1
inputs:
solution: src/uno.uitest.sln
msbuildLocationMethod: version
msbuildVersion: latest
msbuildArchitecture: x86
msbuildArguments: /r /p:Configuration=Release /detailedsummary "/p:PackageOutputPath=$(build.artifactstagingdirectory)\nuget" "/p:PackageVersion=$(GITVERSION.FullSemVer)" "/p:InformationalVersion=$(GITVERSION.InformationalVersion)" /detailedsummary
clean: false
maximumCpuCount: true
restoreNugetPackages: false
logProjectEvents: false
createLogFile: false
- task: DotNetCoreInstaller@0
inputs:
version: '2.1.504'
- task: PowerShell@2
displayName: Authenticode Sign Packages
inputs:
filePath: build/Sign-Package.ps1
env:
SignClientUser: $(SignClientUser)
SignClientSecret: $(SignClientSecret)
SignPackageName: "Uno.PackageDiff"
SignPackageDescription: "Uno.PackageDiff"
ArtifactDirectory: $(build.artifactstagingdirectory)
condition: and(succeeded(), not(eq(variables['build.reason'], 'PullRequest')), not(eq(variables['SignClientSecret'], '')), not(eq(variables['SignClientUser'], '')))
- task: PublishBuildArtifacts@1
condition: always()
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: uno-uitest-drop
ArtifactType: Container
- job: Wasm_UITests
container: nv-bionic-wasm
pool:
vmImage: 'ubuntu-latest'
variables:
NUGET_PACKAGES: $(build.sourcesdirectory)/.nuget
steps:
- checkout: self
clean: true
- task: UseDotNet@2
displayName: 'Use .NET SDK'
retryCountOnTaskFailure: 3
inputs:
packageType: sdk
version: 7.0.302
- bash: |
chmod +x build/wasm-uitest-run.sh
build/wasm-uitest-run.sh
env:
GIT_TARGETBRANCH: "$(System.PullRequest.TargetBranch)"
GIT_SOURCEBRANCH: "$(Build.SourceBranch)"
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
BUILD_ARTIFACTSTAGINGDIRECTORY: "$(build.artifactstagingdirectory)"
displayName: 'Running build'
- task: PublishTestResults@2
inputs:
testRunTitle: 'WebAssembly Test Run'
testResultsFormat: 'NUnit'
testResultsFiles: '$(build.sourcesdirectory)/build/TestResult.xml'
failTaskOnFailedTests: true
searchFolder: '$(System.DefaultWorkingDirectory)' # https://github.com/microsoft/azure-pipelines-tasks/issues/10072
- task: PublishBuildArtifacts@1
condition: always()
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: uno-uitest-tests
ArtifactType: Container
- job: Android_Tests
variables:
CI_Build: true
SourceLinkEnabled: false
pool:
vmImage: 'macOS-12'
steps:
- checkout: self
clean: true
- bash: /bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_12_18"
displayName: Select Xamarin Version
- bash: |
chmod +x $(build.sourcesdirectory)/build/android-uitest-run.sh
$(build.sourcesdirectory)/build/android-uitest-run.sh
displayName: Build and Run Android Tests
env:
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
BUILD_ARTIFACTSTAGINGDIRECTORY: "$(build.artifactstagingdirectory)"
- task: PublishTestResults@2
condition: always()
inputs:
testRunTitle: 'Android Test Run'
testResultsFormat: 'NUnit'
testResultsFiles: '$(build.sourcesdirectory)/build/TestResult.xml'
- task: PublishBuildArtifacts@1
condition: always()
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: uno-uitest-tests
ArtifactType: Container
- job: iOS_Tests
variables:
CI_Build: true
SourceLinkEnabled: false
XCODE_ROOT: /Applications/Xcode_13.4.1.app
pool:
vmImage: 'macOS-12'
steps:
- checkout: self
clean: true
- bash: /bin/bash -c "sudo $AGENT_HOMEDIRECTORY/scripts/select-xamarin-sdk.sh 6_12_18"
displayName: Select Xamarin Version
- bash: /bin/bash -c "echo '##vso[task.setvariable variable=MD_APPLE_SDK_ROOT;]'${XCODE_ROOT};sudo xcode-select --switch ${XCODE_ROOT}/Contents/Developer"
displayName: Select Xcode
- bash: |
chmod +x $(build.sourcesdirectory)/build/ios-uitest-run.sh
$(build.sourcesdirectory)/build/ios-uitest-run.sh
displayName: Build and Run iOS Test
env:
BUILD_SOURCESDIRECTORY: "$(build.sourcesdirectory)"
BUILD_ARTIFACTSTAGINGDIRECTORY: "$(build.artifactstagingdirectory)"
- task: PublishTestResults@2
condition: always()
inputs:
testRunTitle: 'iOS Test Run'
testResultsFormat: 'NUnit'
testResultsFiles: '$(build.sourcesdirectory)/build/TestResult.xml'
- task: PublishBuildArtifacts@1
condition: always()
inputs:
PathtoPublish: $(build.artifactstagingdirectory)
ArtifactName: uno-uitest-tests
ArtifactType: Container