@@ -10,40 +10,46 @@ $resultsXml = "$PSScriptRoot/TestResults.xml"
10
10
$excludes = @ ()
11
11
12
12
$splat = @ {
13
- Path = $TestPath
14
- OutputFile = $resultsXml
13
+ Path = $TestPath
14
+ OutputFile = $resultsXml
15
15
OutputFormat = ' NUnitXML'
16
- PassThru = $true
16
+ PassThru = $true
17
17
}
18
18
19
- if ($env: CI -eq $true ) {
20
- $commit = if ($env: APPVEYOR_PULL_REQUEST_HEAD_COMMIT ) { $env: APPVEYOR_PULL_REQUEST_HEAD_COMMIT } else { $env: APPVEYOR_REPO_COMMIT }
19
+ if ($env: CI -eq $true ) {
20
+ $commit = if ($env: APPVEYOR_PULL_REQUEST_HEAD_COMMIT ) { $env: APPVEYOR_PULL_REQUEST_HEAD_COMMIT } else { $env: APPVEYOR_REPO_COMMIT }
21
21
$commitMessage = " $env: APPVEYOR_REPO_COMMIT_MESSAGE $env: APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED " .TrimEnd()
22
22
23
- if ($commitMessage -match ' !linter' ) {
23
+ if ($commitMessage -match ' !linter' ) {
24
24
Write-Warning " Skipping code linting per commit flag '!linter'"
25
25
$excludes += ' Linter'
26
26
}
27
27
28
28
$changed_scripts = (Get-GitChangedFile - Include ' *.ps1' - Commit $commit )
29
- if (! $changed_scripts ) {
29
+ if (! $changed_scripts ) {
30
30
Write-Warning " Skipping tests and code linting for *.ps1 files because they didn't change"
31
31
$excludes += ' Linter'
32
32
$excludes += ' Scoop'
33
33
}
34
34
35
- if ($commitMessage -match ' !manifests' ) {
35
+ $changed_scripts = (Get-GitChangedFile - Include ' decompress.ps1' - Commit $commit )
36
+ if (! $changed_scripts ) {
37
+ Write-Warning " Skipping tests and code linting for decompress.ps1 files because it didn't change"
38
+ $excludes += ' Decompress'
39
+ }
40
+
41
+ if ($commitMessage -match ' !manifests' ) {
36
42
Write-Warning " Skipping manifest validation per commit flag '!manifests'"
37
43
$excludes += ' Manifests'
38
44
}
39
45
40
46
$changed_manifests = (Get-GitChangedFile - Include ' *.json' - Commit $commit )
41
- if (! $changed_manifests ) {
47
+ if (! $changed_manifests ) {
42
48
Write-Warning " Skipping tests and validation for manifest files because they didn't change"
43
49
$excludes += ' Manifests'
44
50
}
45
51
46
- if ($excludes.Length -gt 0 ) {
52
+ if ($excludes.Length -gt 0 ) {
47
53
$splat.ExcludeTag = $excludes
48
54
}
49
55
}
@@ -53,6 +59,6 @@ $result = Invoke-Pester @splat
53
59
54
60
(New-Object Net.WebClient).UploadFile(" https://ci.appveyor.com/api/testresults/nunit/$ ( $env: APPVEYOR_JOB_ID ) " , $resultsXml )
55
61
56
- if ($result.FailedCount -gt 0 ) {
62
+ if ($result.FailedCount -gt 0 ) {
57
63
exit $result.FailedCount
58
64
}
0 commit comments