testfx/azure-pipelines.yml

160 строки
4.3 KiB
YAML

# Branches that trigger a build on commit
trigger:
branches:
include:
- main
- rel/*
- dev/3.3.X
exclude:
- rel/2.*
- rel/3.0.*
# Branch(es) that trigger(s) build(s) on PR
pr:
branches:
include:
- main
- rel/*
paths:
exclude:
- .github/*
- .devcontainer/*
- docs/*
- .markdownlint.json
- .markdownlintignore
- CODE_OF_CONDUCT.md
- CONTRIBUTING.md
- README.md
- SECURITY.md
- src/**/*.xlf
parameters:
# This option should be used with caution. This is useful for unblocking circular deps issue with testanywhere
- name: SkipTests
displayName: "Skip tests"
type: boolean
default: False
variables:
# Cannot use key:value syntax in root defined variables
- name: _TeamName
value: MSTest
- name: Codeql.Enabled
value: true
- name: _RunAsInternal
value: False
- name: _RunAsPublic
value: True
# Set default value for variables of PR and Public builds
- name: _SignType
value: test
- name: _SignArgs
value: ''
- name: _Sign
value: False
- name: _InternalBuildArgs
value: ' '
- name: _ReleaseVersionKind
value: ''
stages:
- stage: build
displayName: Build
jobs:
- template: /eng/common/templates/jobs/jobs.yml
parameters:
enableMicrobuild: true
enablePublishBuildArtifacts: true
enablePublishTestResults: true
testResultsFormat: 'vstest'
enablePublishBuildAssets: true
enablePublishUsingPipelines: true
enableTelemetry: true
jobs:
- job: Windows
timeoutInMinutes: 90
pool:
name: NetCore-Public
demands: ImageOverride -equals windows.vs2022preview.amd64.open
strategy:
matrix:
Release:
_BuildConfig: Release
Debug:
_BuildConfig: Debug
steps:
- task: PowerShell@2
displayName: 'Install Windows SDK'
inputs:
targetType: filePath
filePath: './eng/install-windows-sdk.ps1'
failOnStderr: true
showWarnings: true
- task: PowerShell@2
displayName: 'Install procdump'
inputs:
targetType: filePath
filePath: ./eng/install-procdump.ps1
failOnStderr: true
showWarnings: true
- script: eng\common\CIBuild.cmd
-configuration $(_BuildConfig)
-prepareMachine
$(_InternalBuildArgs)
/p:Test=false
/p:FastAcceptanceTest=true
name: Build
displayName: Build
- ${{ if eq(parameters.SkipTests, False) }}:
# -ci is allowing to import some environment variables and some required configurations
# -nobl avoids overwriting build binlog with binlog from tests
- script: Test.cmd
-configuration $(_BuildConfig)
-ci
-nobl
name: Test
displayName: Test
# This step is only helpful for diagnosing some issues with vstest/test host that would not appear
# through the console or trx
- task: PublishBuildArtifacts@1
displayName: 'Publish Test Results folders'
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/TestResults/$(_BuildConfig)'
ArtifactName: TestResults
condition: failed()
- job: Linux
timeoutInMinutes: 90
pool:
name: NetCore-Public
demands: ImageOverride -equals build.ubuntu.2004.amd64.open
strategy:
matrix:
Release:
_BuildConfig: Release
Debug:
_BuildConfig: Debug
steps:
- script: eng/common/cibuild.sh
-configuration $(_BuildConfig)
-prepareMachine
/p:Test=false
/p:NonWindowsBuild=true
/p:FastAcceptanceTest=true
displayName: Build
- ${{ if eq(parameters.SkipTests, False) }}:
# --ci is allowing to import some environment variables and some required configurations
# --nobl avoids overwriting build binlog with binlog from tests
- script: |
chmod +x ./test.sh
./test.sh --configuration $(_BuildConfig) --ci --test --integrationTest --nobl
name: Test
displayName: Tests