forked from PowerShell/PSScriptAnalyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
63 lines (58 loc) · 3.19 KB
/
appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
PowerShellEdition: PowerShellCore
BuildConfiguration: Release
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
PowerShellEdition: WindowsPowerShell
BuildConfiguration: Release
- APPVEYOR_BUILD_WORKER_IMAGE: WMF 4
PowerShellEdition: WindowsPowerShell
BuildConfiguration: PSv4Release
- APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
PowerShellEdition: PowerShellCore
BuildConfiguration: Release
# cache Nuget packages and dotnet CLI cache
cache:
- '%USERPROFILE%\.nuget\packages -> appveyor.yml'
- '%LocalAppData%\Microsoft\dotnet -> appveyor.yml'
install:
- ps: if ($env:PowerShellEdition -eq 'WindowsPowerShell') { Import-Module .\tools\appveyor.psm1; Invoke-AppveyorInstall }
- pwsh: if ($env:PowerShellEdition -eq 'PowerShellCore') { Import-Module .\tools\appveyor.psm1; Invoke-AppveyorInstall }
- ps: |
# Windows image still has version 6.0.0 of pwsh but 6.0.2 is required due to System.Management.Automation package https://github.com/appveyor/ci/issues/2230
if ($env:PowerShellEdition -eq 'PowerShellCore' -and $PSVersionTable.PSVersion -lt [version]'6.0.2' -and $IsWindows) {
$msiPath = "$env:TEMP\PowerShell-6.0.2-win-x64.msi"
(New-Object Net.WebClient).DownloadFile('https://github.com/PowerShell/PowerShell/releases/download/v6.0.2/PowerShell-6.0.2-win-x64.msi', $msiPath)
Write-Verbose 'Installing pwsh 6.0.2' -Verbose
Start-Process 'msiexec.exe' -Wait -ArgumentList "/i $msiPath /quiet"
Remove-Item $msiPath
$env:Path = "$env:ProgramFiles\PowerShell\6.0.2;$env:Path"
}
build_script:
- ps: |
if ($env:PowerShellEdition -eq 'WindowsPowerShell') {
if ($env:BuildConfiguration -eq 'PSv4Release') {
# On WMF$: Also build for v3 to check it builds at least since we do not have a WMF3 image
Invoke-AppveyorBuild -CheckoutPath $env:APPVEYOR_BUILD_FOLDER -BuildConfiguration PSv3Release -BuildType 'FullCLR'
}
Invoke-AppveyorBuild -CheckoutPath $env:APPVEYOR_BUILD_FOLDER -BuildConfiguration $env:BuildConfiguration -BuildType 'FullCLR'
}
- pwsh: |
if ($env:PowerShellEdition -eq 'PowerShellCore') {
Import-Module .\tools\appveyor.psm1 # Appveyor does not persist pwsh sessions like it does for ps
Invoke-AppveyorBuild -CheckoutPath $env:APPVEYOR_BUILD_FOLDER -BuildConfiguration $env:BuildConfiguration -BuildType 'NetStandard'
}
test_script:
- ps: |
if ($env:PowerShellEdition -eq 'WindowsPowerShell') {
Invoke-AppveyorTest -CheckoutPath $env:APPVEYOR_BUILD_FOLDER
}
- pwsh: |
if ($env:PowerShellEdition -eq 'PowerShellCore') {
Import-Module .\tools\appveyor.psm1 # Appveyor does not persist pwsh sessions like it does for ps
Invoke-AppveyorTest -CheckoutPath $env:APPVEYOR_BUILD_FOLDER
}
# Upload the project along with test results as a zip archive
on_finish:
- ps: Import-Module .\tools\appveyor.psm1; Invoke-AppveyorFinish