-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI Build updates: build queuing and Windows PS7 (#260)
This updates the CI build with two new features: 1. **Validation against Windows PS7 (PowerShell Core)** This pipeline previously had three platforms that it tested against: * `Windows PS5` * `Linux PS7 (PowerShell Core)` * `macOS PS7 (PowerShell Core)` With this change, we add a fourth platform: `Windows PS7 (PowerShell Core)` 2. **Build queuing** The unit tests operate against live GitHub accounts (as opposed to mocking out the execution of the API calls). Each platform has its own account that it operates against to alllow each platform to be tested in parallel. However, if more than one build is queued at once, then the builds can start to stomp over the expected state in the tests accounts. This change adds a new `job` to the pipeline which will create a "queue" of running builds by only allowing a build to continue processing once all previously queued builds have completed. Initial idea came from here: https://developercommunity.visualstudio.com/idea/365730/prevent-parallel-execution-of-the-same-build-defin.html - Fixes #239
- Loading branch information
1 parent
2740026
commit 79e5ac2
Showing
6 changed files
with
327 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# This template contains the necessary jobs to create a queue for this pipeline and ensure that | ||
# there is never more than one concurrent build actively running at any given time. | ||
# | ||
|
||
#-------------------------------------------------------------------------------------------------- | ||
# This template is dependent on the following pipeline variables being configured within the pipeline. | ||
# | ||
# 1. buildQueryPersonalAccessToken - An Azure DevOps Personal Access Token with Build READ permission. | ||
# It should be configured as a "secret". | ||
#-------------------------------------------------------------------------------------------------- | ||
|
||
parameters: | ||
- name: 'buildQueryPersonalAccessToken' | ||
type: string | ||
- name: 'usePowerShellCore' | ||
default: true | ||
type: boolean | ||
|
||
steps: | ||
- task: PowerShell@2 | ||
displayName: 'Wait for previously queued builds' | ||
inputs: | ||
pwsh: eq('${{ parameters.usePowerShellCore }}', true) | ||
errorActionPreference: 'stop' | ||
workingDirectory: '$(System.DefaultWorkingDirectory)' | ||
targetType: 'inline' | ||
script: | | ||
$params = @{ | ||
PersonalAccessToken = $env:buildReadAccessToken | ||
OrganizationName = 'ms' | ||
ProjectName = 'PowerShellForGitHub' | ||
BuildDefinitionId = $(System.DefinitionId) | ||
BuildId = $(Build.BuildId) | ||
} | ||
./build/scripts/Wait-RunningBuild.ps1 @params | ||
env: | ||
buildReadAccessToken: ${{ parameters.buildQueryPersonalAccessToken }} |
Oops, something went wrong.