forked from cake-build/resources
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
148 lines (75 loc) · 2.36 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
version: 1.0.{build}
image:
- Visual Studio 2017
- Ubuntu
build_script:
- ps: >-
[int] $Result = 0;
# Temporarily skip verification and opt-in to new in-proc NuGet
$ENV:CAKE_SETTINGS_SKIPVERIFICATION='true'
$ENV:CAKE_NUGET_USEINPROCESSCLIENT='true'
'Creating Test Cake File'
'Information("Test success: {0}", DateTime.Now);' > build.cake
'Testing with PowerShell Current'
$OutputA = ./build.ps1 2>&1
$Result = $LastExitCode
$OutputA
if ($Result -ne 0)
{
'PowerShell 3 failed'
exit 3
}
if (-not $IsCoreCLR) {
'Testing with PowerShell V2'
$OutputB = PowerShell -Version 2.0 -File .\build.ps1 2>&1
$Result = $LastExitCode
$OutputB
if ($Result -ne 0)
{
'PowerShell 2 failed'
exit 2
}
}
'Creating Test Module Files'
New-Item -ItemType Directory ./tools/modules
"<?xml version=""1.0"" encoding=""utf-8""?>`r`n<packages>`r`n <package id=""Cake.Chocolatey.Module"" version=""0.5.0"" />`r`n</packages>" | Out-File -Encoding utf8 -FilePath ./tools/modules/packages.config
New-Item -ItemType Directory ./tools/addins
"<?xml version=""1.0"" encoding=""utf-8""?>`r`n<packages>`r`n <package id=""Cake.MicrosoftTeams"" version=""0.7.0"" />`r`n</packages>" | Out-File -Encoding utf8 -FilePath ./tools/addins/packages.config
'Testing with PowerShell Module & Addin restore'
$OutputC = ./build.ps1 2>&1
$Result = $LastExitCode
$OutputC
if ($Result -ne 0)
{
'PowerShell Module failed'
exit 2
}
'Validating StdErr'
$stdErrA = $OutputA | ?{ $_ -is [System.Management.Automation.ErrorRecord] }
$stdErrB = $OutputB | ?{ $_ -is [System.Management.Automation.ErrorRecord] }
$stdErrC = $OutputC | ?{ $_ -is [System.Management.Automation.ErrorRecord] }
$hasStdErrA = ($stdErrA | Measure-Object).Count -gt 0
$hasStdErrB = ($stdErrB | Measure-Object).Count -gt 0
$hasStdErrC = ($stdErrC | Measure-Object).Count -gt 0
if ($hasStdErrA)
{
'Std Error V3'
$stdErrA
exit 3
}
if ($hasStdErrB)
{
'Std Error V2'
$stdErrB
exit 2
}
if ($hasStdErrC)
{
'Module Error'
$stdErrC
exit 4
}
'No Issues found'
artifacts:
- path: '**\*'
name: Resources