-
Notifications
You must be signed in to change notification settings - Fork 233
63 lines (61 loc) · 2.4 KB
/
tests.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
name: Windows Image Builder tests
on: [push, pull_request]
jobs:
code_checks:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
shell: powershell
run: |
Install-Module -Force -AllowClobber -Confirm:$false "PSScriptAnalyzer"
- name: Run code checks
shell: powershell
run: |
$rules = @("PSProvideCommentHelp","PSUseDeclaredVarsMoreThanAssignments","PSAvoidUsingEmptyCatchBlock","PSAvoidUsingCmdletAliases","PSAvoidDefaultValueForMandatoryParameter","PSAvoidDefaultValueSwitchParameter","PSUseToExportFieldsInManifest","PSAvoidUsingPositionalParameters");
$resScryptAnalyzer = Invoke-ScriptAnalyzer -Path . -IncludeRule $rules;
if ($resScryptAnalyzer.Count -gt 0) {
throw "$($resScryptAnalyzer.Count) failed style warnings found."
}
functional_tests_2019:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
shell: powershell
run: |
Uninstall-Module "Pester" -Force
Install-Module -Force -AllowClobber -Confirm:$false "Pester" -RequiredVersion 4.10.1 -SkipPublisherCheck
- name: Run code checks
shell: powershell
run: |
Import-Module Pester
$res = Invoke-Pester -OutputFormat NUnitXml -OutputFile TestsResults.xml -PassThru
if (($res.FailedCount -gt 0)) {
Get-Content -Path TestsResults.xml -Encoding Ascii | Write-Output
throw "$($res.FailedCount) Pester tests failed."
}
functional_tests_latest:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install Dependencies
shell: powershell
run: |
Uninstall-Module "Pester" -Force
Install-Module -Force -AllowClobber -Confirm:$false "Pester" -RequiredVersion 4.10.1 -SkipPublisherCheck
- name: Run code checks
shell: powershell
run: |
Import-Module Pester
$res = Invoke-Pester -OutputFormat NUnitXml -OutputFile TestsResults.xml -PassThru
if (($res.FailedCount -gt 0)) {
Get-Content -Path TestsResults.xml -Encoding Ascii | Write-Output
throw "$($res.FailedCount) Pester tests failed."
}