Teach the security test double the -i call shape #97
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: ci | |
| on: [push, pull_request] | |
| jobs: | |
| shell: | |
| # Both platforms on purpose. Every portability defect found in review broke | |
| # on exactly one of them: BSD vs GNU `stat`, and GNU `sed` rejecting line 0. | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install shellcheck (macOS) | |
| if: runner.os == 'macOS' | |
| run: brew install shellcheck | |
| - name: shellcheck | |
| run: shellcheck -S warning install.sh qbraid-code statusline.sh tests/*.sh | |
| - name: syntax | |
| run: | | |
| bash -n install.sh | |
| bash -n qbraid-code | |
| bash -n statusline.sh | |
| - name: shell tests | |
| run: | | |
| for test in tests/*.sh; do bash "$test"; done | |
| - name: installer --help does not touch the machine | |
| run: bash install.sh --help | |
| powershell: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: PSScriptAnalyzer | |
| shell: pwsh | |
| run: | | |
| Install-Module PSScriptAnalyzer -Force -Scope CurrentUser | |
| $r = Invoke-ScriptAnalyzer -Path . -Severity Error,Warning -Recurse | |
| $r | Format-Table -AutoSize | |
| if ($r | Where-Object { $_.Severity -eq 'Error' }) { exit 1 } | |
| - name: parse every script | |
| shell: pwsh | |
| run: | | |
| foreach ($f in Get-ChildItem *.ps1) { | |
| $errs = $null | |
| [System.Management.Automation.Language.Parser]::ParseFile( | |
| $f.FullName, [ref]$null, [ref]$errs) | Out-Null | |
| if ($errs) { $errs; exit 1 } | |
| "parsed $($f.Name)" | |
| } | |
| - name: Windows profile tests | |
| shell: powershell | |
| run: tests/windows-profiles.ps1 | |
| - name: Claude compatibility policy tests | |
| shell: powershell | |
| run: tests/claude-compat.Tests.ps1 | |
| - name: Windows lifecycle tests | |
| shell: powershell | |
| run: tests/windows-lifecycle.ps1 | |
| - name: Windows native installer lifecycle tests | |
| shell: powershell | |
| run: tests/windows-installer-lifecycle.ps1 | |
| - name: batch launcher is CRLF and BOM-free | |
| shell: pwsh | |
| run: | | |
| $bytes = [IO.File]::ReadAllBytes('qbraid-code.cmd') | |
| if ($bytes[0] -eq 0xEF) { throw 'qbraid-code.cmd must not have a UTF-8 BOM' } | |
| $text = [Text.Encoding]::UTF8.GetString($bytes) | |
| if ($text -notmatch "`r`n") { throw 'qbraid-code.cmd must use CRLF line endings' } | |
| 'CRLF ok, no BOM' | |
| - name: launcher help works without an installation | |
| shell: cmd | |
| run: | | |
| set QBRAID_CODE_HOME=%TEMP%\qc-does-not-exist | |
| call qbraid-code.cmd --help | |
| if errorlevel 1 exit /b 1 | |
| if exist "%QBRAID_CODE_HOME%" exit /b 1 | |
| claude-compat: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - release: '2.1.186' | |
| experimental: false | |
| - release: stable | |
| experimental: false | |
| - release: latest | |
| experimental: true | |
| continue-on-error: ${{ matrix.experimental }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install Claude Code ${{ matrix.release }} | |
| run: curl -fsSL https://claude.ai/install.sh | bash -s "${{ matrix.release }}" | |
| - name: Check installed CLI capabilities | |
| run: | | |
| export PATH="$HOME/.local/bin:$PATH" | |
| tests/claude-installed-compat.sh |