Update the CI builds (#12830)

Include the following changes:
- Use stages for Linux & macOS CI
- Change windows-daily to run tests in one agent
This commit is contained in:
Dongbo Wang
2020-05-29 10:01:29 -07:00
committed by GitHub
parent 99da109312
commit b80375f497
3 changed files with 167 additions and 108 deletions
+52 -49
View File
@@ -40,59 +40,62 @@ variables:
resources:
- repo: self
clean: true
jobs:
- template: templates/ci-build.yml
parameters:
pool: ubuntu-16.04
jobName: linux_build
displayName: linux Build
- template: templates/nix-test.yml
parameters:
name: Linux
pool: ubuntu-16.04
purpose: UnelevatedPesterTests
tagSet: CI
parentJobs:
- linux_build
stages:
- stage: BuildLinux
displayName: Build for Linux
jobs:
- template: templates/ci-build.yml
parameters:
pool: ubuntu-16.04
jobName: linux_build
displayName: linux Build
- template: templates/nix-test.yml
parameters:
name: Linux
pool: ubuntu-16.04
purpose: ElevatedPesterTests
tagSet: CI
parentJobs:
- linux_build
- stage: TestLinux
displayName: Test for Linux
jobs:
- template: templates/nix-test.yml
parameters:
name: Linux
pool: ubuntu-16.04
purpose: UnelevatedPesterTests
tagSet: CI
- template: templates/nix-test.yml
parameters:
name: Linux
pool: ubuntu-16.04
purpose: UnelevatedPesterTests
tagSet: Others
parentJobs:
- linux_build
- template: templates/nix-test.yml
parameters:
name: Linux
pool: ubuntu-16.04
purpose: ElevatedPesterTests
tagSet: CI
- template: templates/nix-test.yml
parameters:
name: Linux
pool: ubuntu-16.04
purpose: ElevatedPesterTests
tagSet: Others
parentJobs:
- linux_build
- template: templates/nix-test.yml
parameters:
name: Linux
pool: ubuntu-16.04
purpose: UnelevatedPesterTests
tagSet: Others
- template: templates/verify-xunit.yml
parameters:
pool: ubuntu-16.04
parentJobs:
- linux_build
- template: templates/nix-test.yml
parameters:
name: Linux
pool: ubuntu-16.04
purpose: ElevatedPesterTests
tagSet: Others
- job: CodeCovTestPackage
- template: templates/verify-xunit.yml
parameters:
pool: ubuntu-16.04
- stage: CodeCovTestPackage
displayName: CodeCoverage and Test Packages
steps:
- powershell: |
Import-Module .\tools\ci.psm1
New-CodeCoverageAndTestPackage
displayName: CodeCoverage and Test Package
dependsOn: [] # by specifying an empty array, this stage doesn't depend on the stage before it
jobs:
- job: CodeCovTestPackage
displayName: CodeCoverage and Test Packages
pool:
vmImage: ubuntu-16.04
steps:
- pwsh: |
Import-Module .\tools\ci.psm1
New-CodeCoverageAndTestPackage
displayName: CodeCoverage and Test Package
+44 -41
View File
@@ -42,51 +42,54 @@ variables:
resources:
- repo: self
clean: true
jobs:
- template: templates/ci-build.yml
parameters:
pool: macOS-latest
jobName: mac_build
displayName: macOS Build
- template: templates/nix-test.yml
parameters:
purpose: UnelevatedPesterTests
tagSet: CI
parentJobs:
- mac_build
stages:
- stage: BuildMac
displayName: Build for macOS
jobs:
- template: templates/ci-build.yml
parameters:
pool: macOS-latest
jobName: mac_build
displayName: macOS Build
- template: templates/nix-test.yml
parameters:
purpose: ElevatedPesterTests
tagSet: CI
parentJobs:
- mac_build
- stage: TestMac
displayName: Test for macOS
jobs:
- template: templates/nix-test.yml
parameters:
purpose: UnelevatedPesterTests
tagSet: CI
- template: templates/nix-test.yml
parameters:
purpose: UnelevatedPesterTests
tagSet: Others
parentJobs:
- mac_build
- template: templates/nix-test.yml
parameters:
purpose: ElevatedPesterTests
tagSet: CI
- template: templates/nix-test.yml
parameters:
purpose: ElevatedPesterTests
tagSet: Others
parentJobs:
- mac_build
- template: templates/nix-test.yml
parameters:
purpose: UnelevatedPesterTests
tagSet: Others
- template: templates/verify-xunit.yml
parameters:
pool: macOS-latest
parentJobs:
- mac_build
- template: templates/nix-test.yml
parameters:
purpose: ElevatedPesterTests
tagSet: Others
- job: CodeCovTestPackage
- template: templates/verify-xunit.yml
parameters:
pool: macOS-latest
- stage: CodeCovTestPackage
displayName: CodeCoverage and Test Packages
steps:
- powershell: |
Import-Module .\tools\ci.psm1
New-CodeCoverageAndTestPackage
displayName: CodeCoverage and Test Package
dependsOn: [] # by specifying an empty array, this stage doesn't depend on the stage before it
jobs:
- job: CodeCovTestPackage
displayName: CodeCoverage and Test Packages
pool:
vmImage: macOS-latest
steps:
- pwsh: |
Import-Module .\tools\ci.psm1
New-CodeCoverageAndTestPackage
displayName: CodeCoverage and Test Package
+71 -18
View File
@@ -49,31 +49,84 @@ stages:
- stage: TestWin
displayName: Test for Windows
jobs:
- template: templates/windows-test.yml
parameters:
purpose: UnelevatedPesterTests
tagSet: CI
- job: win_test
pool:
vmImage: vs2017-win2016
displayName: Windows Test
- template: templates/windows-test.yml
parameters:
purpose: ElevatedPesterTests
tagSet: CI
steps:
- pwsh: |
Get-ChildItem -Path env:
displayName: 'Capture Environment'
condition: succeededOrFailed()
- template: templates/windows-test.yml
parameters:
purpose: UnelevatedPesterTests
tagSet: Others
- task: DownloadBuildArtifacts@0
displayName: 'Download Build Artifacts'
inputs:
downloadType: specific
itemPattern: |
build/**/*
xunit/**/*
downloadPath: '$(System.ArtifactsDirectory)'
- template: templates/windows-test.yml
parameters:
purpose: ElevatedPesterTests
tagSet: Others
- pwsh: |
Get-ChildItem "$(System.ArtifactsDirectory)\*" -Recurse
displayName: 'Capture Artifacts Directory'
continueOnError: true
- template: templates/verify-xunit.yml
# must be run frow Windows PowerShell
- powershell: |
Import-Module .\tools\ci.psm1
Invoke-CIInstall
displayName: Bootstrap
condition: succeededOrFailed()
- pwsh: |
Import-Module .\build.psm1
Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json'
$path = Split-Path -Parent (Get-PSOutput -Options (Get-PSOptions))
$rootPath = Split-Path -Path $path
Expand-Archive -Path '$(System.ArtifactsDirectory)\build\build.zip' -DestinationPath $rootPath -Force
displayName: 'Unzip Build'
condition: succeeded()
- pwsh: |
Import-Module .\tools\ci.psm1
Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json'
Invoke-CITest -Purpose UnelevatedPesterTests -TagSet CI
displayName: Test - UnelevatedPesterTests - CI
condition: succeeded()
- pwsh: |
Import-Module .\tools\ci.psm1
Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json'
Invoke-CITest -Purpose ElevatedPesterTests -TagSet CI
displayName: Test - ElevatedPesterTests - CI
condition: succeededOrFailed()
- pwsh: |
Import-Module .\tools\ci.psm1
Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json'
Invoke-CITest -Purpose UnelevatedPesterTests -TagSet Others
displayName: Test - UnelevatedPesterTests - Others
condition: succeededOrFailed()
- pwsh: |
Import-Module .\tools\ci.psm1
Restore-PSOptions -PSOptionsPath '$(System.ArtifactsDirectory)\build\psoptions.json'
Invoke-CITest -Purpose ElevatedPesterTests -TagSet Others
displayName: Test - ElevatedPesterTests - Others
condition: succeededOrFailed()
- pwsh: |
Import-Module .\build.psm1
$xUnitTestResultsFile = "$(System.ArtifactsDirectory)\xunit\xUnitTestResults.xml"
Test-XUnitTestResults -TestResultsFile $xUnitTestResultsFile
displayName: Verify xUnit Test Results
condition: succeededOrFailed()
- stage: PackagingWin
displayName: Packaging for Windows
jobs:
# Unlike daily builds, we do not upload nuget package to MyGet so we do not wait on tests to finish.
- template: templates/windows-packaging.yml