feat: zoom-center-on-cursor, deep-clone helper, UI polish #6
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: test | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| # Opt in to Node 24 runtime for actions/* (Node 20 is deprecated; | |
| # forced default in June 2026, removed in September 2026). | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true" | |
| jobs: | |
| headless: | |
| name: Pure-logic tests (pwsh 7.5+) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install PowerShell 7.5+ (SnipIT.ps1 requires it) | |
| shell: bash | |
| run: | | |
| dotnet tool install --global PowerShell | |
| echo "$HOME/.dotnet/tools" >> "$GITHUB_PATH" | |
| - name: Show pwsh version | |
| shell: bash | |
| run: pwsh --version | |
| - name: Run headless tests | |
| shell: bash | |
| run: pwsh -NoProfile -File ./Test-SnipIT.ps1 | |
| lint: | |
| name: PSScriptAnalyzer (Error severity gate) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install PSScriptAnalyzer | |
| shell: pwsh | |
| run: Install-Module PSScriptAnalyzer -Scope CurrentUser -Force -SkipPublisherCheck | |
| - name: Surface warnings (non-blocking) | |
| shell: pwsh | |
| run: | | |
| Import-Module PSScriptAnalyzer | |
| $w = Invoke-ScriptAnalyzer -Path ./SnipIT.ps1 -Severity Warning | |
| Write-Host "Warning count: $((@($w)).Count)" | |
| $w | Group-Object RuleName | Sort-Object Count -Descending | | |
| Select-Object Count, Name | Format-Table -AutoSize | Out-String | Write-Host | |
| - name: Fail on Error-severity findings | |
| shell: pwsh | |
| run: | | |
| Import-Module PSScriptAnalyzer | |
| $errs = Invoke-ScriptAnalyzer -Path ./SnipIT.ps1 -Severity Error | |
| $count = (@($errs)).Count | |
| Write-Host "Error count: $count" | |
| if ($count -gt 0) { | |
| $errs | Format-Table -AutoSize Severity, RuleName, Line, Message | | |
| Out-String | Write-Host | |
| exit 1 | |
| } | |
| parse: | |
| name: Parse SnipIT.ps1 on Windows (no execution) | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install PowerShell 7.5+ (SnipIT.ps1 requires it) | |
| shell: pwsh | |
| run: | | |
| dotnet tool install --global PowerShell | |
| "$HOME\.dotnet\tools" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8 | |
| - name: Show pwsh version | |
| shell: bash | |
| run: pwsh --version | |
| - name: Parse script (AST parser works with any pwsh version) | |
| shell: bash | |
| run: | | |
| pwsh -NoProfile -Command " | |
| \$errors = \$null | |
| [System.Management.Automation.Language.Parser]::ParseFile( | |
| (Resolve-Path ./SnipIT.ps1), [ref]\$null, [ref]\$errors) | Out-Null | |
| if (\$errors) { | |
| \$errors | ForEach-Object { Write-Host \" \$(\$_.Message) at line \$(\$_.Extent.StartLineNumber)\" } | |
| exit 1 | |
| } | |
| Write-Host 'Parsed cleanly.' | |
| " | |
| - name: Run headless tests on Windows | |
| shell: bash | |
| run: pwsh -NoProfile -File ./Test-SnipIT.ps1 |