forked from PowerShell/PSScriptAnalyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
55 lines (50 loc) · 2.39 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
environment:
PSVersion: 5
BuildConfiguration: Release
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true # For faster CI builds
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: WMF 4
PowerShellEdition: WindowsPowerShell
PSVersion: 4
## Only the tests for WMF4 remain active in AppVeyor due to Azure DevOps not offering such images ##
# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
# PowerShellEdition: PowerShellCore
# - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
# PowerShellEdition: WindowsPowerShell
# - APPVEYOR_BUILD_WORKER_IMAGE: Ubuntu
# PowerShellEdition: PowerShellCore
# cache Nuget packages and dotnet CLI cache
cache:
- '%USERPROFILE%\.nuget\packages -> 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 }
build_script:
- ps: |
if ( $env:PowerShellEdition -eq 'WindowsPowerShell' ) {
Set-Location $env:APPVEYOR_BUILD_FOLDER
if ( $env:PSVersion -eq "4" ) { # On WMF4: Also build for v3 to check it builds at least since we do not have a WMF3 image
./build.ps1 -Configuration "$env:BuildConfiguration" -PSVersion 3
}
./build.ps1 -Configuration "$env:BuildConfiguration" -PSVersion "$env:PSVersion"
./PSCompatibilityCollector/build.ps1 -Configuration "$env:BuildConfiguration" -Framework 'net462'
}
- pwsh: |
if ($env:PowerShellEdition -eq 'PowerShellCore') {
Set-Location $env:APPVEYOR_BUILD_FOLDER
./build.ps1 -Configuration "$env:BuildConfiguration" -PSVersion 7
./PSCompatibilityCollector/build.ps1 -Configuration "$env:BuildConfiguration" -Framework 'net6'
}
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 "${env:APPVEYOR_BUILD_FOLDER}\tools\appveyor.psm1"; Invoke-AppveyorFinish