Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows
ci: Modernize CI and resolve environment configuration issues
Maximilian Roosca19035ffc70
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.ymlindex 2082fe822..6543cf552 100644--- a/.github/workflows/ci.yml+++ b/.github/workflows/ci.yml@@ -6,53 +6,72 @@ on:pull_request:branches: [ main ]+env:+ CARGO_TERM_COLOR: always+ RUSTFLAGS: "-C debuginfo=0"+ RUSTDOCFLAGS: "-Dwarnings"+jobs:test:name: Test (Tier 1 shells only)runs-on: ubuntu-lateststeps:- - uses: actions/checkout@v4+ - name: π Checkout code+ uses: actions/checkout@v5- name: Install Rustuses: dtolnay/rust-toolchain@stablewith:components: rustfmt, clippy- - name: Cache cargo registry- uses: actions/cache@v4+ - name: Install cargo-insta+ uses: baptiste0928/cargo-install@v3with:- path: ~/.cargo/registry- key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}+ crate: cargo-insta- - name: Cache cargo index- uses: actions/cache@v4+ - name: Install cargo-nextest+ uses: baptiste0928/cargo-install@v3with:- path: ~/.cargo/git- key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}+ crate: cargo-nextest- - name: Cache cargo build- uses: actions/cache@v4+ - name: π° Cache+ uses: Swatinem/rust-cache@v2with:- path: target- key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}+ prefix-key: ${{ hashFiles('Cargo.lock') }}+ save-if: ${{ github.ref == 'refs/heads/main' }}- name: Install Tier 1 shells (bash, zsh, fish)run: |sudo apt-get updatesudo apt-get install -y zsh fish- - name: Check formatting- run: cargo fmt --check+ - name: π Compile+ uses: clechasseur/rs-cargo@v4+ with:+ command: test+ args: --no-run --locked- - name: Run clippy- run: cargo clippy --all-targets --all-features -- -D warnings+ - name: π Test+ uses: clechasseur/rs-cargo@v4+ with:+ command: insta+ args: test --test-runner=nextest- - name: Build- run: cargo build --verbose+ - name: π Clippy+ uses: clechasseur/rs-cargo@v4+ with:+ command: clippy+ args: --all-targets --all-features -- -D warnings- - name: Run tests (Tier 1 shells only)- run: cargo test --verbose+ - name: β¨οΈ Fmt+ uses: clechasseur/rs-cargo@v4+ with:+ command: fmt+ args: --all --check- - name: Build release- run: cargo build --release --verbose+ - name: ποΈ Doc+ uses: clechasseur/rs-cargo@v4+ with:+ command: doc+ args: --no-depsdiff --git a/.github/workflows/tier-2-integration-tests.yml b/.github/workflows/tier-2-integration-tests.ymlindex e1a033186..f2326625f 100644--- a/.github/workflows/tier-2-integration-tests.yml+++ b/.github/workflows/tier-2-integration-tests.yml@@ -6,34 +6,32 @@ on:pull_request:branches: [ main ]+env:+ CARGO_TERM_COLOR: always+ RUSTFLAGS: "-C debuginfo=0"+jobs:tier-2-tests:name: Tier 2 Shell Integration Testsruns-on: ubuntu-lateststeps:- - uses: actions/checkout@v4+ - name: π Checkout code+ uses: actions/checkout@v5- name: Install Rustuses: dtolnay/rust-toolchain@stable- - name: Cache cargo registry- uses: actions/cache@v4- with:- path: ~/.cargo/registry- key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}-- - name: Cache cargo index- uses: actions/cache@v4+ - name: Install cargo-nextest+ uses: baptiste0928/cargo-install@v3with:- path: ~/.cargo/git- key: ${{ runner.os }}-cargo-git-${{ hashFiles('**/Cargo.lock') }}+ crate: cargo-nextest- - name: Cache cargo build- uses: actions/cache@v4+ - name: π° Cache+ uses: Swatinem/rust-cache@v2with:- path: target- key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}+ prefix-key: ${{ hashFiles('Cargo.lock') }}+ save-if: ${{ github.ref == 'refs/heads/main' }}- name: Install Tier 1 shells (bash, zsh, fish)run: |@@ -95,8 +93,14 @@ jobs:which xonsh && xonsh --versionwhich oil || which osh- - name: Run tier-2 integration tests- run: cargo test --test integration --features tier-2-integration-tests --verbose+ - name: π Run tier-2 integration tests+ uses: clechasseur/rs-cargo@v4+ with:+ command: nextest+ args: run --test integration --features tier-2-integration-tests- - name: Run all tests with tier-2 features- run: cargo test --all --features tier-2-integration-tests+ - name: π Run all tests with tier-2 features+ uses: clechasseur/rs-cargo@v4+ with:+ command: nextest+ args: run --all --features tier-2-integration-testsdiff --git a/rust-toolchain.toml b/rust-toolchain.tomlnew file mode 100644index 000000000..43e5784a1--- /dev/null+++ b/rust-toolchain.toml@@ -0,0 +1,3 @@+[toolchain]+channel = "1.90.0"+components = ["rustfmt", "clippy"]diff --git a/src/commands/config.rs b/src/commands/config.rsindex cfa0733db..0e5921115 100644--- a/src/commands/config.rs+++ b/src/commands/config.rs@@ -135,6 +135,17 @@ fn display_project_config() -> Result<(), GitError> {}fn get_global_config_path() -> Option<PathBuf> {+ // Respect HOME environment variable for testing+ if let Ok(home) = std::env::var("HOME") {+ let home_path = PathBuf::from(home);+ return Some(+ home_path+ .join(".config")+ .join("worktrunk")+ .join("config.toml"),+ );+ }+let strategy = choose_base_strategy().ok()?;Some(strategy.config_dir().join("worktrunk").join("config.toml"))}