diff --git a/.azure-pipelines-ci/ci.yaml b/.azure-pipelines-ci/ci.yaml index 71ec55030..ea54c7c57 100644 --- a/.azure-pipelines-ci/ci.yaml +++ b/.azure-pipelines-ci/ci.yaml @@ -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: diff --git a/.azure-pipelines-ci/templates/test.yaml b/.azure-pipelines-ci/templates/test.yaml index 2acdcc6f5..c5c5fd894 100644 --- a/.azure-pipelines-ci/templates/test.yaml +++ b/.azure-pipelines-ci/templates/test.yaml @@ -1,7 +1,11 @@ parameters: -- name: pwsh - type: boolean - default: true +- name: PowerShellVersion + type: string + default: LTS + values: + - WindowsPowerShell + - LTS + - Preview steps: - task: DownloadPipelineArtifact@2 @@ -9,11 +13,23 @@ steps: 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