forked from iamshital/LISAv2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
azure-pipelines.yml
41 lines (41 loc) · 1.24 KB
/
azure-pipelines.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
name: 'code_quality'
variables:
enable_all: 'true'
jobs:
- job: 'UnitTests_Pester'
timeoutInMinutes: 10
cancelTimeoutInMinutes: 12
strategy:
parallel: 1
pool:
vmImage: 'win1803'
steps:
- powershell: Install-Module -Name Pester -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber
- powershell:
$pesterResult = Invoke-Pester -PassThru;
if ($pesterResult.FailedCount) {
echo "Pester unit tests have failed.";
exit 1;
} else {
echo "Pester unit tests have passed.";
}
- job: 'PowerShellCodeCheck_PSScriptAnalyzer'
timeoutInMinutes: 10
cancelTimeoutInMinutes: 12
strategy:
parallel: 1
pool:
vmImage: 'win1803'
steps:
- powershell: Install-Module -Name PSScriptAnalyzer -Scope CurrentUser -Force -SkipPublisherCheck -AllowClobber
- powershell:
$rules = @(
"PSUseDeclaredVarsMoreThanAssignments", "PSAvoidTrailingWhitespace"
);
$errors = Invoke-ScriptAnalyzer -Path . -Recurse -IncludeRule $rules;
if ($errors.Count -gt 0) {
echo $errors;
exit 1;
} else {
echo "PSScriptAnalyzer checks have passed."
}