Skip to content

Merge pull request #383 from ym/virtio-win2k22 #3

Merge pull request #383 from ym/virtio-win2k22

Merge pull request #383 from ym/virtio-win2k22 #3

Workflow file for this run

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."
}