-
Notifications
You must be signed in to change notification settings - Fork 72
Add CI workflows to test install scripts and support local binary override #480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
svarlamov
merged 5 commits into
main
from
codex/create-github-actions-for-install-scripts-testing
Feb 8, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e767b4c
Add CI coverage for install scripts
svarlamov c4fe469
Fix Windows home env for installer checks
svarlamov 14a62ba
Respect home env overrides
svarlamov 90ca4e5
Align home resolution on Windows
svarlamov 5b41dc2
clippy fixes
svarlamov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,129 @@ | ||
| name: Install Scripts (Local Build) | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| push: | ||
| branches: [main] | ||
| merge_group: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| install-local-unix: | ||
| name: Local install.sh on ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| override: true | ||
|
|
||
| - name: Build git-ai | ||
| run: cargo build --release --bin git-ai | ||
|
|
||
| - name: Prepare test home and fake Claude Code | ||
| run: | | ||
| TEST_HOME="$RUNNER_TEMP/git-ai-home" | ||
| mkdir -p "$TEST_HOME/.config/fish" "$TEST_HOME/.claude" | ||
| touch "$TEST_HOME/.bashrc" "$TEST_HOME/.zshrc" "$TEST_HOME/.config/fish/config.fish" | ||
| echo "HOME=$TEST_HOME" >> "$GITHUB_ENV" | ||
|
|
||
| BIN_DIR="$RUNNER_TEMP/fake-bin" | ||
| mkdir -p "$BIN_DIR" | ||
| cat > "$BIN_DIR/claude" <<'EOF' | ||
| #!/bin/sh | ||
| echo "2.0.0 (Claude Code)" | ||
| EOF | ||
| chmod +x "$BIN_DIR/claude" | ||
| echo "$BIN_DIR" >> "$GITHUB_PATH" | ||
|
|
||
| - name: Run install.sh with local binary | ||
| env: | ||
| GIT_AI_LOCAL_BINARY: ${{ github.workspace }}/target/release/git-ai | ||
| run: | | ||
| chmod +x ./install.sh | ||
| ./install.sh | ||
|
|
||
| - name: Verify shell configs and Claude hooks | ||
| run: | | ||
| INSTALL_DIR="$HOME/.git-ai/bin" | ||
| test -x "$INSTALL_DIR/git-ai" | ||
| grep -F "$INSTALL_DIR" "$HOME/.bashrc" | ||
| grep -F "$INSTALL_DIR" "$HOME/.zshrc" | ||
| grep -F "fish_add_path -g \"$INSTALL_DIR\"" "$HOME/.config/fish/config.fish" | ||
| grep -F "checkpoint claude" "$HOME/.claude/settings.json" | ||
|
|
||
| install-local-windows: | ||
| name: Local install.ps1 on windows-latest | ||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install Rust toolchain | ||
| uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| override: true | ||
|
|
||
| - name: Build git-ai | ||
| run: cargo build --release --bin git-ai | ||
|
|
||
| - name: Prepare test home and fake Claude Code | ||
| shell: pwsh | ||
| run: | | ||
| $testHome = Join-Path $env:RUNNER_TEMP "git-ai-home" | ||
| New-Item -ItemType Directory -Force -Path $testHome | Out-Null | ||
| $homeDrive = [System.IO.Path]::GetPathRoot($testHome).TrimEnd('\') | ||
| $homePath = $testHome.Substring($homeDrive.Length) | ||
| Add-Content -Path $env:GITHUB_ENV -Value "TEST_HOME=$testHome" | ||
| Add-Content -Path $env:GITHUB_ENV -Value "TEST_HOME_DRIVE=$homeDrive" | ||
| Add-Content -Path $env:GITHUB_ENV -Value "TEST_HOME_PATH=$homePath" | ||
|
|
||
| $claudeDir = Join-Path $testHome ".claude" | ||
| New-Item -ItemType Directory -Force -Path $claudeDir | Out-Null | ||
|
|
||
| $binDir = Join-Path $env:RUNNER_TEMP "fake-bin" | ||
| New-Item -ItemType Directory -Force -Path $binDir | Out-Null | ||
| $claudeCmd = Join-Path $binDir "claude.cmd" | ||
| "@echo 2.0.0 (Claude Code)" | Out-File -FilePath $claudeCmd -Encoding ASCII -Force | ||
| Add-Content -Path $env:GITHUB_PATH -Value $binDir | ||
|
|
||
| - name: Run install.ps1 with local binary | ||
| shell: pwsh | ||
| env: | ||
| GIT_AI_LOCAL_BINARY: ${{ github.workspace }}\target\release\git-ai.exe | ||
| HOME: ${{ env.TEST_HOME }} | ||
| USERPROFILE: ${{ env.TEST_HOME }} | ||
| HOMEDRIVE: ${{ env.TEST_HOME_DRIVE }} | ||
| HOMEPATH: ${{ env.TEST_HOME_PATH }} | ||
| run: | | ||
| Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force | ||
| ./install.ps1 | ||
|
|
||
| - name: Verify Claude hooks | ||
| shell: pwsh | ||
| env: | ||
| HOME: ${{ env.TEST_HOME }} | ||
| USERPROFILE: ${{ env.TEST_HOME }} | ||
| HOMEDRIVE: ${{ env.TEST_HOME_DRIVE }} | ||
| HOMEPATH: ${{ env.TEST_HOME_PATH }} | ||
| run: | | ||
| $installDir = Join-Path $env:USERPROFILE ".git-ai\bin" | ||
| if (-not (Test-Path -LiteralPath (Join-Path $installDir "git-ai.exe"))) { throw "git-ai.exe not installed" } | ||
| $settings = Join-Path $env:USERPROFILE ".claude\settings.json" | ||
| if (-not (Select-String -Path $settings -Pattern "checkpoint claude")) { throw "Claude hooks not configured" } |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| name: Install Scripts (Nightly) | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 3 * * *" | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| install-nightly-unix: | ||
| name: Nightly install.sh on ${{ matrix.os }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest] | ||
|
|
||
| steps: | ||
| - name: Prepare test home and fake Claude Code | ||
| run: | | ||
| TEST_HOME="$RUNNER_TEMP/git-ai-home" | ||
| mkdir -p "$TEST_HOME/.config/fish" "$TEST_HOME/.claude" | ||
| touch "$TEST_HOME/.bashrc" "$TEST_HOME/.zshrc" "$TEST_HOME/.config/fish/config.fish" | ||
| echo "HOME=$TEST_HOME" >> "$GITHUB_ENV" | ||
|
|
||
| BIN_DIR="$RUNNER_TEMP/fake-bin" | ||
| mkdir -p "$BIN_DIR" | ||
| cat > "$BIN_DIR/claude" <<'EOF' | ||
| #!/bin/sh | ||
| echo "2.0.0 (Claude Code)" | ||
| EOF | ||
| chmod +x "$BIN_DIR/claude" | ||
| echo "$BIN_DIR" >> "$GITHUB_PATH" | ||
|
|
||
| - name: Run install.sh from usegitai.com | ||
| run: curl -fsSL https://usegitai.com/install.sh | bash | ||
|
|
||
| - name: Verify shell configs and Claude hooks | ||
| run: | | ||
| INSTALL_DIR="$HOME/.git-ai/bin" | ||
| test -x "$INSTALL_DIR/git-ai" | ||
| grep -F "$INSTALL_DIR" "$HOME/.bashrc" | ||
| grep -F "$INSTALL_DIR" "$HOME/.zshrc" | ||
| grep -F "fish_add_path -g \"$INSTALL_DIR\"" "$HOME/.config/fish/config.fish" | ||
| grep -F "checkpoint claude" "$HOME/.claude/settings.json" | ||
|
|
||
| install-nightly-windows: | ||
| name: Nightly install.ps1 on windows-latest | ||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
| - name: Prepare test home and fake Claude Code | ||
| shell: pwsh | ||
| run: | | ||
| $testHome = Join-Path $env:RUNNER_TEMP "git-ai-home" | ||
| New-Item -ItemType Directory -Force -Path $testHome | Out-Null | ||
| $homeDrive = [System.IO.Path]::GetPathRoot($testHome).TrimEnd('\') | ||
| $homePath = $testHome.Substring($homeDrive.Length) | ||
| Add-Content -Path $env:GITHUB_ENV -Value "TEST_HOME=$testHome" | ||
| Add-Content -Path $env:GITHUB_ENV -Value "TEST_HOME_DRIVE=$homeDrive" | ||
| Add-Content -Path $env:GITHUB_ENV -Value "TEST_HOME_PATH=$homePath" | ||
|
|
||
| $claudeDir = Join-Path $testHome ".claude" | ||
| New-Item -ItemType Directory -Force -Path $claudeDir | Out-Null | ||
|
|
||
| $binDir = Join-Path $env:RUNNER_TEMP "fake-bin" | ||
| New-Item -ItemType Directory -Force -Path $binDir | Out-Null | ||
| $claudeCmd = Join-Path $binDir "claude.cmd" | ||
| "@echo 2.0.0 (Claude Code)" | Out-File -FilePath $claudeCmd -Encoding ASCII -Force | ||
| Add-Content -Path $env:GITHUB_PATH -Value $binDir | ||
|
|
||
| - name: Run install.ps1 from usegitai.com | ||
| shell: pwsh | ||
| env: | ||
| HOME: ${{ env.TEST_HOME }} | ||
| USERPROFILE: ${{ env.TEST_HOME }} | ||
| HOMEDRIVE: ${{ env.TEST_HOME_DRIVE }} | ||
| HOMEPATH: ${{ env.TEST_HOME_PATH }} | ||
| run: | | ||
| Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process -Force | ||
| Invoke-WebRequest -UseBasicParsing https://usegitai.com/install.ps1 | Invoke-Expression | ||
|
|
||
| - name: Verify Claude hooks | ||
| shell: pwsh | ||
| env: | ||
| HOME: ${{ env.TEST_HOME }} | ||
| USERPROFILE: ${{ env.TEST_HOME }} | ||
| HOMEDRIVE: ${{ env.TEST_HOME_DRIVE }} | ||
| HOMEPATH: ${{ env.TEST_HOME_PATH }} | ||
| run: | | ||
| $installDir = Join-Path $env:USERPROFILE ".git-ai\bin" | ||
| if (-not (Test-Path -LiteralPath (Join-Path $installDir "git-ai.exe"))) { throw "git-ai.exe not installed" } | ||
| $settings = Join-Path $env:USERPROFILE ".claude\settings.json" | ||
| if (-not (Select-String -Path $settings -Pattern "checkpoint claude")) { throw "Claude hooks not configured" } |
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 install.ps1 prints misleading "Downloading" message when using a local binary override
When
GIT_AI_LOCAL_BINARYis set, theinstall.ps1script unconditionally prints"Downloading git-ai (release: local)..."at line 299, even though no download occurs — the binary is copied locally. Theinstall.shscript correctly handles this with a conditional message ("Using local git-ai binary"vs"Downloading git-ai"at lines 246/252).Root Cause
The
Write-Hostatinstall.ps1:299was not updated to be conditional when the local binary override was added. Ininstall.sh, the message was properly split:But in
install.ps1, the message at line 299 is always printed before the conditional logic at line 316:Impact: Users and CI logs will show a misleading "Downloading" message when the local binary override is in use, causing confusion during debugging.
(Refers to line 299)
Was this helpful? React with 👍 or 👎 to provide feedback.