mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2026-08-09 17:41:14 +10:00
* Clean up analyzer warnings * Align analyzer warning cleanup policy * Run PSScriptAnalyzer directly in unittests workflow * Bind lazy-rendered buttons to click handlers * Remove WinUtil performance tracing * Fix Win11 ISO creator temp directory reuse
52 lines
1.6 KiB
YAML
52 lines
1.6 KiB
YAML
name: Unit Tests
|
|
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
lint:
|
|
name: PS Script Analyzer
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- name: Install PSScriptAnalyzer
|
|
run: |
|
|
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
|
|
Install-Module -Name PSScriptAnalyzer -RequiredVersion 1.20.0 -Scope CurrentUser -Force
|
|
Import-Module PSScriptAnalyzer -RequiredVersion 1.20.0 -Force
|
|
Get-Module PSScriptAnalyzer | Select-Object Name, Version, Path
|
|
shell: pwsh
|
|
- name: Run PSScriptAnalyzer
|
|
run: |
|
|
$results = Invoke-ScriptAnalyzer -Path . -Settings ./lint/PSScriptAnalyser.ps1 -Recurse
|
|
if ($results) {
|
|
$results | Format-Table -AutoSize | Out-String -Width 4096 | Write-Host
|
|
} else {
|
|
Write-Host "PSScriptAnalyzer found no diagnostics."
|
|
}
|
|
shell: pwsh
|
|
test:
|
|
runs-on: windows-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v7
|
|
|
|
- name: Install Pester
|
|
run: |
|
|
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
|
|
Install-Module -Name Pester -RequiredVersion 5.8.0 -Force -SkipPublisherCheck -AllowClobber
|
|
Import-Module Pester -RequiredVersion 5.8.0 -Force
|
|
Get-Module Pester | Select-Object Name, Version, Path
|
|
shell: pwsh
|
|
|
|
- name: Run Pester tests
|
|
run: |
|
|
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
|
|
Import-Module Pester -RequiredVersion 5.8.0 -Force
|
|
Invoke-Pester -Path 'pester/*.Tests.ps1' -Output Detailed -CI
|
|
|
|
shell: pwsh
|
|
env:
|
|
TEMP: ${{ runner.temp }}
|