Updated psd1 #112
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
name: CI | |
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
branches: | |
- 'main' | |
# Allow manually triggering of the workflow. | |
workflow_dispatch: {} | |
env: | |
MODULE_NAME: WinGet-Essentials | |
jobs: | |
test: | |
name: Run Tests | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install PSScriptAnalyzer | |
shell: pwsh | |
run: | | |
Set-PSRepository PSGallery -InstallationPolicy Trusted | |
Install-Module PSScriptAnalyzer -ErrorAction Stop | |
- name: Lint with PSScriptAnalyzer | |
shell: pwsh | |
run: | | |
Invoke-ScriptAnalyzer -Path "$env:MODULE_NAME" -Recurse -OutVariable issues | |
$errors = $issues.Where({$_.Severity -eq 'Error'}) | |
$warnings = $issues.Where({$_.Severity -eq 'Warning'}) | |
if ($errors) { | |
Write-Error "There were $($errors.Count) errors and $($warnings.Count) warnings total." -ErrorAction Stop | |
} else { | |
Write-Output "There were $($errors.Count) errors and $($warnings.Count) warnings total." | |
} | |
- name: Test Manifest | |
shell: pwsh | |
run: | | |
. .github/workflows/workaround.ps1 | |
Push-Location | |
Set-Location $env:MODULE_NAME | |
Build-RequiredModuleFiles | |
Pop-Location | |
Test-ModuleManifest "$env:MODULE_NAME/$env:MODULE_NAME.psd1" -Verbose | |
if (-not($?)) { | |
Write-Error "Manifest validation failed." -ErrorAction Stop | |
} | |
- name: Test Module | |
shell: pwsh | |
run: | | |
Invoke-Pester |