Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running PowerShell Preview or Daily in CI #1439

Draft
wants to merge 18 commits into
base: main
Choose a base branch
from
32 changes: 25 additions & 7 deletions .azure-pipelines-ci/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,40 @@ stages:
matrix:
Ubuntu_16_04:
vmImage: ubuntu-16.04
Ubuntu_16_04_PSPreview:
vmImage: ubuntu-16.04
PowerShellVersion: Preview
Ubuntu_18_04:
vmImage: ubuntu-18.04
Ubuntu_18_04_PSPreview:
vmImage: ubuntu-18.04
PowerShellVersion: Preview
macOS_10_14_Mojave:
vmImage: macOS-10.14
macOS_10_14_PSPreview:
vmImage: macOS-10.14
PowerShellVersion: Preview
macOS_10_15_Catalina:
vmImage: macOS-10.15
Windows_Server2016_PowerShell_Core:
macOS_10_15_PSPreview:
vmImage: macOS-10.15
PowerShellVersion: Preview
Win2016:
vmImage: vs2017-win2016
Windows_Server2019_PowerShell_Core:
vmImage: windows-2019
Windows_Server2016_PowerShell_5_1:
Win2016_PSPreview:
vmImage: vs2017-win2016
PowerShellVersion: Preview
Win2016_PowerShell_5_1:
vmImage: vs2017-win2016
pwsh: false
Windows_Server2019_PowerShell_5_1:
PowerShellVersion: WindowsPowerShell
Win2019:
vmImage: windows-2019
Win2019_PSPreview:
vmImage: windows-2019
PowerShellVersion: Preview
Win2019_PS5:
vmImage: windows-2019
pwsh: false
PowerShellVersion: WindowsPowerShell
pool:
vmImage: $[ variables['vmImage'] ]
steps:
Expand Down
24 changes: 20 additions & 4 deletions .azure-pipelines-ci/templates/test.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,35 @@
parameters:
- name: pwsh
type: boolean
default: true
- name: PowerShellVersion
type: string
default: LTS
values:
- WindowsPowerShell
- LTS
- Preview

steps:
- task: DownloadPipelineArtifact@2
displayName: 'Download Pipeline Artifact: out Folder'
inputs:
artifactName: out
targetPath: '$(Build.SourcesDirectory)/out'
- pwsh: |
Write-Host "Installing PowerShell Preview..."
# Use `AGENT_TEMPDIRECTORY` to make sure the downloaded PowerShell is cleaned up.
$powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell'
Invoke-WebRequest -Uri https://aka.ms/install-powershell.ps1 -OutFile ./install-powershell.ps1
./install-powershell.ps1 -Destination $powerShellPath -Daily
# Using `prependpath` to update the PATH just for this build.
Write-Host "##vso[task.prependpath]$powerShellPath"
displayName: Install PowerShell Daily
condition: eq(variables['PowerShellVersion'], 'Preview')
- pwsh: '$PSVersionTable'
displayName: Display PowerShell version information
- task: PowerShell@2
displayName: 'Test'
inputs:
targetType: inline
pwsh: ${{ parameters.pwsh }}
pwsh: ne(variables['PowerShellVersion'], 'WindowsPowerShell')
script: |
Import-Module .\tools\appveyor.psm1
Invoke-AppveyorTest -CheckoutPath $env:BUILD_SOURCESDIRECTORY
Expand Down