Convert Install-SpecKitTemplate.ps1 into a PowerShell module #23
Workflow file for this run
This file contains hidden or 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: PowerShell CI | |
| on: | |
| push: | |
| branches: | |
| - 'v1_specsdev' | |
| - '001-create-a-powershell' | |
| - 'feature/**' | |
| pull_request: | |
| branches: | |
| - 'v1_specsdev' | |
| - 'main' | |
| jobs: | |
| lint-and-test: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: List tests directory contents | |
| run: | | |
| ls -l tests | |
| - name: Install PSScriptAnalyzer and Pester | |
| run: | | |
| Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser -AcceptLicense | |
| Install-Module -Name Pester -MinimumVersion 5.0.0 -Force -Scope CurrentUser -AcceptLicense | |
| - name: Enforce no absolute paths in scripts | |
| run: | | |
| pwsh -NoProfile -Command "Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass; ./scripts/check-absolute-paths.ps1 -Path ." | |
| - name: Run PSScriptAnalyzer | |
| run: | | |
| pwsh -NoProfile -Command "Invoke-ScriptAnalyzer -Path . -Recurse -Settings .psscriptanalyzer.psd1" | |
| - name: Run Pester tests | |
| run: | | |
| pwsh -NoProfile -Command 'Import-Module Pester -MinimumVersion 5.0.0 -Force; $r = Pester\Invoke-Pester -Path .\tests -PassThru; if ($r.FailedCount -gt 0) { exit 1 }' | |
| # pwsh -NoProfile -Command "Import-Module Pester -RequiredVersion 5.0.0 -Force; $r = Pester\Invoke-Pester -Path .\tests -PassThru; if ($r.FailedCount -gt 0) { exit 1 }" | |
| integration-tests: | |
| runs-on: windows-latest | |
| needs: lint-and-test | |
| # Only run on pull_request events with the 'run-integration' label. This reduces CI minutes for branch pushes. | |
| if: ${{ github.event_name == 'pull_request' && contains(join(',', github.event.pull_request.labels.*.name), 'run-integration') }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Pester | |
| run: | | |
| pwsh -Command "Install-Module -Name Pester -MinimumVersion 5.0.0 -Force -Scope CurrentUser -AcceptLicense" | |
| - name: Run integration tests only | |
| run: | | |
| pwsh -NoProfile -Command "Import-Module Pester -MinimumVersion 5.0.0 -Force; $r = Pester\Invoke-Pester -Path .\tests\integration -PassThru; if ($r.FailedCount -gt 0) { exit 1 }" |