Skip to content

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

Add MSRV, unused deps, and benchmark CI jobs (#28)

Maximilian Roos539628ee1668
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 68c285509..1c37e0141 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -148,3 +148,91 @@ jobs:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: pre-commit run lychee --all-files
continue-on-error: true
+
+ # Check if Cargo files changed (for conditional jobs below)
+ changes:
+ name: Detect changes
+ runs-on: ubuntu-latest
+ permissions:
+ contents: read
+ pull-requests: read
+ outputs:
+ cargo: ${{ steps.filter.outputs.cargo }}
+ steps:
+ - name: πŸ“‚ Checkout code
+ uses: actions/checkout@v5
+ - uses: dorny/paths-filter@v3
+ id: filter
+ with:
+ filters: |
+ cargo:
+ - 'Cargo.toml'
+ - 'Cargo.lock'
+ - 'rust-toolchain.toml'
+
+ msrv:
+ name: MSRV
+ runs-on: ubuntu-latest
+ needs: changes
+ if: needs.changes.outputs.cargo == 'true' || github.event_name == 'workflow_dispatch'
+ steps:
+ - name: πŸ“‚ Checkout code
+ uses: actions/checkout@v5
+
+ - uses: baptiste0928/cargo-install@v3
+ with:
+ crate: cargo-msrv
+
+ - name: Verify minimum rust version
+ run: cargo msrv verify
+
+ check-unused-dependencies:
+ name: Unused dependencies
+ runs-on: ubuntu-latest
+ needs: changes
+ if: needs.changes.outputs.cargo == 'true' || github.event_name == 'workflow_dispatch'
+ steps:
+ - name: πŸ“‚ Checkout code
+ uses: actions/checkout@v5
+
+ # cargo-udeps requires nightly; update date periodically
+ - run: rustup override set nightly-2025-11-10
+
+ - uses: baptiste0928/cargo-install@v3
+ with:
+ crate: cargo-udeps
+
+ - uses: clechasseur/rs-cargo@v4
+ with:
+ command: udeps
+ args: --all-targets --locked
+
+ benchmarks:
+ name: Benchmarks
+ runs-on: ubuntu-latest
+ needs: changes
+ if: needs.changes.outputs.cargo == 'true' || github.event_name == 'workflow_dispatch'
+ steps:
+ - name: πŸ“‚ Checkout code
+ uses: actions/checkout@v5
+
+ - name: Install Rust
+ uses: dtolnay/rust-toolchain@stable
+
+ - name: πŸ’° Cache
+ uses: Swatinem/rust-cache@v2
+ with:
+ prefix-key: ${{ hashFiles('Cargo.lock') }}
+ save-if: ${{ github.ref == 'refs/heads/main' }}
+
+ - name: Install shells (zsh, fish)
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y zsh fish
+
+ - name: πŸ“Š Run benchmarks
+ uses: clechasseur/rs-cargo@v4
+ with:
+ command: bench
+ # Run completion benchmarks (list has slow real_repo tests)
+ args: --locked --bench completion -- --warm-up-time 0.3 --measurement-time 1
diff --git a/Cargo.lock b/Cargo.lock
index eabeae904..5b3324321 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -654,20 +654,6 @@ dependencies = [
"syn",
]
-[[package]]
-name = "dashmap"
-version = "6.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5041cc499144891f3790297212f32a74fb938e5136a14943f338ef9e0ae276cf"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
- "hashbrown 0.14.5",
- "lock_api",
- "once_cell",
- "parking_lot_core",
-]
-
[[package]]
name = "defer-drop"
version = "1.3.0"
@@ -3041,7 +3027,6 @@ dependencies = [
"console 0.16.1",
"criterion",
"crossbeam-channel",
- "dashmap",
"directories",
"env_logger",
"etcetera",
diff --git a/Cargo.toml b/Cargo.toml
index e018daedc..b8ebdf178 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -5,6 +5,7 @@ members = ["tests/helpers/dev-detach", "tests/helpers/setup-select-test"]
name = "worktrunk"
version = "0.1.5"
edition = "2024"
+rust-version = "1.89"
build = "build.rs"
repository = "https://github.com/max-sixty/worktrunk"
description = "A Git worktree manager for trunk-based development"
@@ -44,7 +45,6 @@ clap_complete = { version = "4.5", features = ["unstable-dynamic"] }
config = "0.15"
console = "0.16"
crossbeam-channel = "0.5"
-dashmap = "6.1"
directories = "6.0"
env_logger = "0.11"
indexmap = { version = "2.12", features = ["serde"] }