-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (97 loc) · 3.44 KB
/
Copy pathci.yml
File metadata and controls
113 lines (97 loc) · 3.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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