Give 'claude mcp login' a real terminal under curl | bash (#11) #39
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/statusline.sh tests/extractors.sh tests/model-routing.sh | |
| - name: syntax | |
| run: | | |
| bash -n install.sh | |
| bash -n qbraid-code | |
| bash -n statusline.sh | |
| - name: statusline tests | |
| run: tests/statusline.sh | |
| - name: extractor tests | |
| run: tests/extractors.sh | |
| - name: model routing tests | |
| run: tests/model-routing.sh | |
| - 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: 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 reports a missing install instead of crashing | |
| shell: cmd | |
| run: | | |
| set QBRAID_CODE_HOME=%TEMP%\qc-does-not-exist | |
| call qbraid-code.cmd --help | |
| if not errorlevel 1 exit /b 1 | |
| echo missing-install path reports an error | |
| rem `echo` does not reset ERRORLEVEL in cmd, so the expected 1 would | |
| rem otherwise leak out and fail the step. | |
| exit /b 0 |