Avalonia/azure-pipelines-integration...

108 строки
2.8 KiB
YAML

jobs:
- job: Mac
pool:
name: 'AvaloniaMacPool'
steps:
- task: UseDotNet@2
displayName: 'Use .NET 6.0 Runtime'
inputs:
packageType: runtime
version: 6.0.x
- task: UseDotNet@2
displayName: 'Use .NET 8.0 SDK'
inputs:
packageType: sdk
useGlobalJson: true
- script: system_profiler SPDisplaysDataType |grep Resolution
displayName: 'Get Resolution'
- script: |
arch="x64"
if [[ $(uname -m) == 'arm64' ]]; then
arch="arm64"
fi
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
pkill node
pkill testmanagerd
appium > appium.out &
pkill IntegrationTestApp
./build.sh CompileNative
rm -rf $(osascript -e "POSIX path of (path to application id \"net.avaloniaui.avalonia.integrationtestapp\")")
pkill IntegrationTestApp
./samples/IntegrationTestApp/bundle.sh
open -n ./samples/IntegrationTestApp/bin/Debug/net8.0/osx-$arch/publish/IntegrationTestApp.app
pkill IntegrationTestApp
displayName: 'Build IntegrationTestApp'
- task: DotNetCoreCLI@2
displayName: 'Run Integration Tests'
inputs:
command: 'test'
projects: 'tests/Avalonia.IntegrationTests.Appium/Avalonia.IntegrationTests.Appium.csproj'
arguments: '-l "console;verbosity=detailed"'
- script: |
pkill IntegrationTestApp
pkill node
displayName: 'Stop Appium'
- publish: appium.out
displayName: 'Publish appium logs on failure'
condition: failed()
- job: Windows
pool:
vmImage: 'windows-2022'
steps:
- task: UseDotNet@2
displayName: 'Use .NET 6.0 Runtime'
inputs:
packageType: runtime
version: 6.0.x
- task: UseDotNet@2
displayName: 'Use .NET 8.0 SDK'
inputs:
packageType: sdk
useGlobalJson: true
- task: Windows Application Driver@0
inputs:
OperationType: 'Start'
AgentResolution: '4K'
displayName: 'Start WinAppDriver'
- task: DotNetCoreCLI@2
displayName: 'Build IntegrationTestApp'
inputs:
command: 'build'
projects: 'samples/IntegrationTestApp/IntegrationTestApp.csproj'
- task: DotNetCoreCLI@2
displayName: 'Build test project'
inputs:
command: 'build'
projects: 'tests\Avalonia.IntegrationTests.Appium\Avalonia.IntegrationTests.Appium.csproj'
- task: VSTest@2
displayName: 'Run Integration Tests'
inputs:
testAssemblyVer2: '**\bin\**\Avalonia.IntegrationTests.Appium.dll'
runSettingsFile: 'tests\Avalonia.IntegrationTests.Appium\record-video.runsettings'
- task: PublishTestResults@2
displayName: 'Publish test results'
inputs:
testResultsFormat: 'XUnit'
testResultsFiles: '**/*.trx'
condition: succeededOrFailed()
- task: Windows Application Driver@0
inputs:
OperationType: 'Stop'
displayName: 'Stop WinAppDriver'