Skip to content

WIP Add WMF4 to build matrix in AppVeyor #44

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
2 changes: 2 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ environment:
PSEdition: Core
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
PSEdition: Desktop
- APPVEYOR_BUILD_WORKER_IMAGE: WMF 4
PSEdition: Desktop

build_script:
- ps: if ( $env:PSEdition -eq 'Desktop' ) { ./tst/test.ps1 -CIBuild }
Expand Down
26 changes: 16 additions & 10 deletions tst/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ try {
# makes every test run slow because Get-PackagerProvider
# takes 10 seconds
if ($CIBuild) {
$minimumNugetProviderVersion = '2.8.5.201'
# not using the -Name parameter because it throws when Nuget is not installed
if (-not (Get-PackageProvider -ListAvailable | Where-Object { $_.Name -eq "Nuget" -and $_.Version -ge $minimumNugetProviderVersion })) {
"Installing Nuget package provider."
Install-PackageProvider -Name NuGet -MinimumVersion $minimumNugetProviderVersion -Force
}

$minimumPesterVersion = "4.4.3"
if (-not (Get-Module -ListAvailable | Where-Object { $_.Name -eq"Pester" -and $_.Version -ge $minimumPesterVersion })) {
"Installing Pester."
Install-Module -Name Pester -Force -MinimumVersion $minimumPesterVersion -Scope CurrentUser
if ($env:AppVeyor -and $null -eq (Get-Module -ListAvailable PowershellGet)) {
# WMF 4 image build
Write-Verbose -Verbose "Installing Pester via nuget"
nuget install Pester -Version $minimumPesterVersion -source https://www.powershellgallery.com/api/v2 -outputDirectory "$env:ProgramFiles\WindowsPowerShell\Modules\." -ExcludeVersion
}
else {
$minimumNugetProviderVersion = '2.8.5.201'
# not using the -Name parameter because it throws when Nuget is not installed
if (-not (Get-PackageProvider -ListAvailable | Where-Object { $_.Name -eq "Nuget" -and $_.Version -ge $minimumNugetProviderVersion })) {
"Installing Nuget package provider."
Install-PackageProvider -Name NuGet -MinimumVersion $minimumNugetProviderVersion -Force
}
if (-not (Get-Module -ListAvailable | Where-Object { $_.Name -eq"Pester" -and $_.Version -ge $minimumPesterVersion })) {
"Installing Pester."
Install-Module -Name Pester -Force -MinimumVersion $minimumPesterVersion -Scope CurrentUser
}
}
}

Expand Down