Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

chore: consolidate Claude CI setup into composite action (#1273)

worktrunk-botaa46fe5e07b4
diff --git a/.github/actions/claude-setup/action.yaml b/.github/actions/claude-setup/action.yaml
new file mode 100644
index 000000000..fc57da9dd
--- /dev/null
+++ b/.github/actions/claude-setup/action.yaml
@@ -0,0 +1,41 @@
+name: Claude CI Setup
+description: Install cargo tools, Rust cache, and test shells for Claude CI workflows
+
+inputs:
+ install-cargo-tools:
+ description: Install cargo-insta and cargo-nextest
+ default: "true"
+ install-shells:
+ description: Install zsh and fish for shell integration tests
+ default: "true"
+
+runs:
+ using: composite
+ steps:
+ - name: Install cargo-insta
+ if: inputs.install-cargo-tools == 'true'
+ uses: baptiste0928/cargo-install@v3
+ with:
+ crate: cargo-insta
+ version: "=1.46.3"
+
+ - name: Install cargo-nextest
+ if: inputs.install-cargo-tools == 'true'
+ uses: baptiste0928/cargo-install@v3
+ with:
+ crate: cargo-nextest
+ # Pin: 0.9.129 requires rustc 1.91, we use 1.90 (rust-toolchain.toml).
+ version: "=0.9.128"
+
+ - name: "\U0001F4B0 Cache"
+ uses: Swatinem/rust-cache@v2
+ with:
+ prefix-key: ${{ hashFiles('Cargo.lock') }}
+ save-if: false
+
+ - name: Install shells (zsh, fish)
+ if: inputs.install-shells == 'true'
+ shell: bash
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y zsh fish
diff --git a/.github/workflows/claude-ci-fix.yaml b/.github/workflows/claude-ci-fix.yaml
index e034eeef3..84856a8a5 100644
--- a/.github/workflows/claude-ci-fix.yaml
+++ b/.github/workflows/claude-ci-fix.yaml
@@ -35,29 +35,8 @@ jobs:
# Use bot token so pushed commits trigger CI workflows
token: ${{ secrets.WORKTRUNK_BOT_TOKEN }}
- - name: Install cargo-insta
- uses: baptiste0928/cargo-install@v3
- with:
- crate: cargo-insta
- version: "=1.46.3"
-
- - name: Install cargo-nextest
- uses: baptiste0928/cargo-install@v3
- with:
- crate: cargo-nextest
- # Pin: 0.9.129 requires rustc 1.91, we use 1.90 (rust-toolchain.toml).
- version: "=0.9.128"
-
- - name: πŸ’° Cache
- uses: Swatinem/rust-cache@v2
- with:
- prefix-key: ${{ hashFiles('Cargo.lock') }}
- save-if: false
-
- - name: Install shells (zsh, fish)
- run: |
- sudo apt-get update
- sudo apt-get install -y zsh fish
+ - name: πŸ”§ Setup build tools
+ uses: ./.github/actions/claude-setup
- name: πŸ€– Run Claude Code to fix CI
id: claude
diff --git a/.github/workflows/claude-issue-triage.yaml b/.github/workflows/claude-issue-triage.yaml
index d3827f7c0..7caa695ae 100644
--- a/.github/workflows/claude-issue-triage.yaml
+++ b/.github/workflows/claude-issue-triage.yaml
@@ -46,29 +46,8 @@ jobs:
# Use bot token so pushed commits trigger CI workflows
token: ${{ secrets.WORKTRUNK_BOT_TOKEN }}
- - name: Install cargo-insta
- uses: baptiste0928/cargo-install@v3
- with:
- crate: cargo-insta
- version: "=1.46.3"
-
- - name: Install cargo-nextest
- uses: baptiste0928/cargo-install@v3
- with:
- crate: cargo-nextest
- # Pin: 0.9.129 requires rustc 1.91, we use 1.90 (rust-toolchain.toml).
- version: "=0.9.128"
-
- - name: πŸ’° Cache
- uses: Swatinem/rust-cache@v2
- with:
- prefix-key: ${{ hashFiles('Cargo.lock') }}
- save-if: false
-
- - name: Install shells (zsh, fish)
- run: |
- sudo apt-get update
- sudo apt-get install -y zsh fish
+ - name: πŸ”§ Setup build tools
+ uses: ./.github/actions/claude-setup
- name: πŸ€– Run Claude Code to triage issue
id: claude
diff --git a/.github/workflows/claude-mention.yaml b/.github/workflows/claude-mention.yaml
index d03328cc3..767771105 100644
--- a/.github/workflows/claude-mention.yaml
+++ b/.github/workflows/claude-mention.yaml
@@ -150,29 +150,8 @@ jobs:
env:
GH_TOKEN: ${{ secrets.WORKTRUNK_BOT_TOKEN }}
- - name: Install cargo-insta
- uses: baptiste0928/cargo-install@v3
- with:
- crate: cargo-insta
- version: "=1.46.3"
-
- - name: Install cargo-nextest
- uses: baptiste0928/cargo-install@v3
- with:
- crate: cargo-nextest
- # Pin: 0.9.129 requires rustc 1.91, we use 1.90 (rust-toolchain.toml).
- version: "=0.9.128"
-
- - name: πŸ’° Cache
- uses: Swatinem/rust-cache@v2
- with:
- prefix-key: ${{ hashFiles('Cargo.lock') }}
- save-if: false
-
- - name: Install shells (zsh, fish)
- run: |
- sudo apt-get update
- sudo apt-get install -y zsh fish
+ - name: πŸ”§ Setup build tools
+ uses: ./.github/actions/claude-setup
- name: πŸ€– Run Claude Code
if: steps.verify.outcome != 'failure'
diff --git a/.github/workflows/claude-nightly-cleaner.yaml b/.github/workflows/claude-nightly-cleaner.yaml
index 02bba80c9..4b89db762 100644
--- a/.github/workflows/claude-nightly-cleaner.yaml
+++ b/.github/workflows/claude-nightly-cleaner.yaml
@@ -36,29 +36,8 @@ jobs:
# Use bot token so pushed commits trigger CI workflows
token: ${{ secrets.WORKTRUNK_BOT_TOKEN }}
- - name: Install cargo-insta
- uses: baptiste0928/cargo-install@v3
- with:
- crate: cargo-insta
- version: "=1.46.3"
-
- - name: Install cargo-nextest
- uses: baptiste0928/cargo-install@v3
- with:
- crate: cargo-nextest
- # Pin: 0.9.129 requires rustc 1.91, we use 1.90 (rust-toolchain.toml).
- version: "=0.9.128"
-
- - name: πŸ’° Cache
- uses: Swatinem/rust-cache@v2
- with:
- prefix-key: ${{ hashFiles('Cargo.lock') }}
- save-if: false
-
- - name: Install shells (zsh, fish)
- run: |
- sudo apt-get update
- sudo apt-get install -y zsh fish
+ - name: πŸ”§ Setup build tools
+ uses: ./.github/actions/claude-setup
- name: πŸ€– Run Claude Code for nightly cleanup
id: claude
diff --git a/.github/workflows/claude-nightly-review-reviewers.yaml b/.github/workflows/claude-nightly-review-reviewers.yaml
index 9bbca99d9..dda5ecf4b 100644
--- a/.github/workflows/claude-nightly-review-reviewers.yaml
+++ b/.github/workflows/claude-nightly-review-reviewers.yaml
@@ -35,29 +35,8 @@ jobs:
# Use bot token so pushed commits trigger CI workflows
token: ${{ secrets.WORKTRUNK_BOT_TOKEN }}
- - name: Install cargo-insta
- uses: baptiste0928/cargo-install@v3
- with:
- crate: cargo-insta
- version: "=1.46.3"
-
- - name: Install cargo-nextest
- uses: baptiste0928/cargo-install@v3
- with:
- crate: cargo-nextest
- # Pin: 0.9.129 requires rustc 1.91, we use 1.90 (rust-toolchain.toml).
- version: "=0.9.128"
-
- - name: πŸ’° Cache
- uses: Swatinem/rust-cache@v2
- with:
- prefix-key: ${{ hashFiles('Cargo.lock') }}
- save-if: false
-
- - name: Install shells (zsh, fish)
- run: |
- sudo apt-get update
- sudo apt-get install -y zsh fish
+ - name: πŸ”§ Setup build tools
+ uses: ./.github/actions/claude-setup
- name: πŸ€– Run Claude Code to review reviewers
id: claude
diff --git a/.github/workflows/claude-renovate.yaml b/.github/workflows/claude-renovate.yaml
index bfd9b1c5b..882bf1066 100644
--- a/.github/workflows/claude-renovate.yaml
+++ b/.github/workflows/claude-renovate.yaml
@@ -31,11 +31,11 @@ jobs:
fetch-tags: true
token: ${{ secrets.WORKTRUNK_BOT_TOKEN }}
- - name: πŸ’° Cache
- uses: Swatinem/rust-cache@v2
+ - name: πŸ”§ Setup build tools
+ uses: ./.github/actions/claude-setup
with:
- prefix-key: ${{ hashFiles('Cargo.lock') }}
- save-if: false
+ install-cargo-tools: "false"
+ install-shells: "false"
- name: πŸ€– Run Claude Code for renovation
id: claude
@@ -75,7 +75,7 @@ jobs:
- Check if newer versions are available for: cargo-nextest, cargo-insta, lychee, worktrunk, cargo-msrv, cargo-udeps, cargo-llvm-cov
- To check: look up the tool's MSRV on crates.io or its repo and compare against the channel in `rust-toolchain.toml`
- Only update the pin if the new version is compatible with our rustc
- - Update pins in ALL workflow files that use the tool (ci.yaml and claude-*.yaml)
+ - Update pins in ALL workflow files that use the tool (ci.yaml and .github/actions/claude-setup/action.yaml)
## How to check
diff --git a/.github/workflows/claude-review.yaml b/.github/workflows/claude-review.yaml
index 54411f983..a9c7e85c1 100644
--- a/.github/workflows/claude-review.yaml
+++ b/.github/workflows/claude-review.yaml
@@ -60,33 +60,9 @@ jobs:
env:
GH_TOKEN: ${{ secrets.WORKTRUNK_BOT_TOKEN }}
- - name: Install cargo-insta
+ - name: πŸ”§ Setup build tools
if: github.event_name == 'pull_request_review'
- uses: baptiste0928/cargo-install@v3
- with:
- crate: cargo-insta
- version: "=1.46.3"
-
- - name: Install cargo-nextest
- if: github.event_name == 'pull_request_review'
- uses: baptiste0928/cargo-install@v3
- with:
- crate: cargo-nextest
- # Pin: 0.9.129 requires rustc 1.91, we use 1.90 (rust-toolchain.toml).
- version: "=0.9.128"
-
- - name: πŸ’° Cache
- if: github.event_name == 'pull_request_review'
- uses: Swatinem/rust-cache@v2
- with:
- prefix-key: ${{ hashFiles('Cargo.lock') }}
- save-if: false
-
- - name: Install shells (zsh, fish)
- if: github.event_name == 'pull_request_review'
- run: |
- sudo apt-get update
- sudo apt-get install -y zsh fish
+ uses: ./.github/actions/claude-setup
- name: πŸ€– Run Claude Code
id: claude