Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 21 additions & 11 deletions tools/devops/automation/run-post-pr-build-tests.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
# YAML pipeline for post build operations.
# This pipeline will execute the tests for the CI on PR as soon as the workloads have been complited.
# YAML pipeline for post build operations.
# This pipeline will build the workloads and then execute the tests for the CI on a PR.

trigger: none
pr: none

# we cannot use a template in a pipeline context
resources:
pipelines:
- pipeline: macios
source: \Xamarin\Mac-iOS\pr pipelines\xamarin-macios-pr
trigger:
stages:
- build_packages
pr:
autoCancel: true
branches:
include:
- '*' # yes, you do need the quote, * has meaning in yamls
paths:
exclude:
- .github
- docs
- CODEOWNERS
- ISSUE_TEMPLATE.md
- LICENSE
- NOTICE.txt
- SECURITY.MD
- README.md
- src/README.md
- tools/mtouch/README.md
- msbuild/Xamarin.Localization.MSBuild/README.md

extends:
template: templates/pipelines/run-tests-pipeline.yml
parameters:
isPR: true
buildPackages: true
14 changes: 13 additions & 1 deletion tools/devops/automation/templates/common/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,19 @@ steps:
$testMatrix = $testMatrix | ConvertFrom-Json | ConvertTo-Json -Compress
# update the config file so that we do not recalculate the matrix in other pipelines
Edit-BuildConfiguration -ConfigKey TEST_MATRIX -ConfigValue $testMatrix -ConfigFile $Env:CONFIG_PATH
#CONFIG_PATH
Write-Host "##vso[task.setvariable variable=TEST_MATRIX;isOutput=true]$testMatrix"

# also compute the simulator test matrix and set it as output variable so that
# dependent stages in post-build test pipelines can consume it
$simulatorTestMatrix = Get-TestConfiguration `
-TestConfigurations "$Env:TEST_CONFIGURATIONS" `
-SupportedPlatforms "$Env:SUPPORTED_PLATFORMS" `
-EnabledPlatforms "$Env:CONFIGURE_PLATFORMS_DOTNET_PLATFORMS" `
-TestsLabels "${{ parameters.testsLabels }}" `
-StatusContext "${{ parameters.statusContext }}" `
-StageFilter "simulator_tests"
$simulatorTestMatrix = $simulatorTestMatrix | ConvertFrom-Json | ConvertTo-Json -Compress
Write-Host "##vso[task.setvariable variable=SIMULATOR_TEST_MATRIX;isOutput=true]$simulatorTestMatrix"
name: test_matrix
displayName: 'Create tests strategy matrix'
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ parameters:
type: boolean
default: true

- name: buildPackages
displayName: Build packages as part of this pipeline (instead of downloading from a pipeline resource)
type: boolean
default: false

resources:
repositories:
- repository: self
Expand All @@ -56,3 +61,4 @@ stages:
provisionatorChannel: ${{ parameters.provisionatorChannel }}
runTests: ${{ parameters.runTests }}
runWindowsIntegration: ${{ parameters.runWindowsIntegration }}
buildPackages: ${{ parameters.buildPackages }}
87 changes: 75 additions & 12 deletions tools/devops/automation/templates/tests-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ parameters:
type: string
default: ''

- name: buildPackages
type: boolean
default: false

stages:

- template: ./build/linux-build-verification.yml
Expand Down Expand Up @@ -148,13 +152,69 @@ stages:
BRANCH_NAME: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ]

steps:
- template: common/load_configuration.yml
parameters:
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}
statusContext: 'VSTS: simulator tests'
uploadArtifacts: true
use1ES: false
- ${{ if eq(parameters.buildPackages, true) }}:
# When building packages in this pipeline, generate configuration from scratch
- template: common/configure.yml
parameters:
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}
statusContext: 'VSTS: simulator tests'
uploadArtifacts: true
use1ES: false
isPR: ${{ parameters.isPR }}
- ${{ else }}:
# When using pre-built packages from a pipeline resource, load existing configuration
- template: common/load_configuration.yml
parameters:
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}
statusContext: 'VSTS: simulator tests'
uploadArtifacts: true
use1ES: false

# When buildPackages is true, build packages as part of this pipeline
- ${{ if eq(parameters.buildPackages, true) }}:
- stage: build_packages
displayName: '${{ parameters.stageDisplayNamePrefix }}Build'
dependsOn: [configure_build]
jobs:
- job: build
displayName: 'Build packages'
timeoutInMinutes: 1000
variables:
DOTNET_PLATFORMS: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.DOTNET_PLATFORMS'] ]
INCLUDE_DOTNET_IOS: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_DOTNET_IOS'] ]
INCLUDE_DOTNET_MACCATALYST: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_DOTNET_MACCATALYST'] ]
INCLUDE_DOTNET_MACOS: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_DOTNET_MACOS'] ]
INCLUDE_DOTNET_TVOS: $[ stageDependencies.configure_build.configure.outputs['configure_platforms.INCLUDE_DOTNET_TVOS'] ]
BuildPackage: $[ stageDependencies.configure_build.configure.outputs['labels.build_package'] ]
SkipPackages: $[ stageDependencies.configure_build.configure.outputs['labels.skip_packages'] ]
SkipNugets: $[ stageDependencies.configure_build.configure.outputs['labels.skip_nugets'] ]
SkipSigning: $[ stageDependencies.configure_build.configure.outputs['labels.skip_signing'] ]
SkipApiComparison: $[ stageDependencies.configure_build.configure.outputs['labels.skip_api_comparison'] ]
PR_ID: $[ stageDependencies.configure_build.configure.outputs['labels.pr_number'] ]
BRANCH_NAME: $[ replace(variables['Build.SourceBranch'], 'refs/heads/', '') ]
XHARNESS_LABELS: $[ stageDependencies.configure_build.configure.outputs['labels.xharness_labels'] ]
RUN_MAC_TESTS: $[ stageDependencies.configure_build.configure.outputs['decisions.RUN_MAC_TESTS'] ]
pool:
name: $(PRBuildPool)
demands:
- Agent.OS -equals Darwin
- Agent.OSVersion -gtVersion $(minimumMacOSVersion)
- macOS.Name -equals ${{ parameters.macOSName }}
- XcodeChannel -equals ${{ parameters.xcodeChannel }}
steps:
- template: build/build-pkgs.yml
parameters:
isPR: ${{ parameters.isPR }}
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}
vsdropsPrefix: ${{ variables.vsdropsPrefix }}
keyringPass: $(pass--lab--mac--builder--keychain)
gitHubToken: $(Github.Token)
xqaCertPass: $(xqa--certificates--password)
use1ES: false
xcodeChannel: ${{ parameters.xcodeChannel }}

# always run simulator tests
- template: ./tests/stage.yml
Expand All @@ -173,7 +233,7 @@ stages:
gitHubToken: $(Github.Token)
xqaCertPass: $(xqa--certificates--password)
condition: ${{ parameters.runTests }}
postPipeline: true
postPipeline: ${{ not(parameters.buildPackages) }}

- template: ./tests/publish-results.yml
parameters:
Expand All @@ -185,7 +245,7 @@ stages:
isPR: ${{ parameters.isPR }}
repositoryAlias: ${{ parameters.repositoryAlias }}
commit: ${{ parameters.commit }}
postPipeline: true
postPipeline: ${{ not(parameters.buildPackages) }}
macTestsConfigurations: ${{ parameters.macTestsConfigurations }}

- ${{ if eq(parameters.runWindowsIntegration, true) }}:
Expand All @@ -200,11 +260,14 @@ stages:
statusContext: 'Windows Integration Tests'
gitHubToken: $(Github.Token)
xqaCertPass: $(xqa--certificates--password)
postPipeline: true
postPipeline: ${{ not(parameters.buildPackages) }}

- stage: build_macos_tests
displayName: '${{ parameters.stageDisplayNamePrefix }}Build macOS tests'
dependsOn: [configure_build]
dependsOn:
- configure_build
- ${{ if eq(parameters.buildPackages, true) }}:
- build_packages
condition: and(succeeded(), ne(dependencies.configure_build.outputs['configure.configure_platforms.DOTNET_PLATFORMS'], ''))
jobs:
- template: ./build/build-mac-tests-stage.yml
Expand Down Expand Up @@ -234,5 +297,5 @@ stages:
keyringPass: $(pass--lab--mac--builder--keychain)
demands: ${{ config.demands }}
xqaCertPass: $(xqa--certificates--password)
postPipeline: true
postPipeline: ${{ not(parameters.buildPackages) }}
label: ${{ config.label }}
2 changes: 2 additions & 0 deletions tools/devops/automation/templates/windows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ stages:
displayName: ${{ parameters.displayName }}
dependsOn:
- configure_build
- ${{ if not(parameters.postPipeline) }}:
- build_packages
condition: and(succeeded(), eq(dependencies.configure_build.outputs['configure.decisions.RUN_WINDOWS_TESTS'], 'true'))

jobs:
Expand Down
Loading