-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #398 from ader1990/add_github_actions_v2
Add github actions
- Loading branch information
Showing
3 changed files
with
67 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.