testfx/azure-pipelines.yml

143 строки
4.3 KiB
YAML

# 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: _RunAsInternal
value: False
- name: _RunAsPublic
value: True
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
/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
# Upload code coverage data
- script: $(Build.SourcesDirectory)/.dotnet/dotnet msbuild -restore
eng/CodeCoverage.proj
/p:Configuration=$(_BuildConfig)
/bl:$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\CodeCoverage.binlog
displayName: Upload coverage to codecov.io
condition: and(succeeded(), eq(variables._BuildConfig, 'Debug'))
# 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