diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0b6f805..eb4b458 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,11 @@ env: jobs: unit-tests: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v6 - name: Build @@ -20,13 +24,29 @@ jobs: run: cargo test --verbose e2e-tests: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash steps: - uses: actions/checkout@v6 - - name: Install bats + - name: Install bats (Linux) + if: runner.os == 'Linux' run: | git clone https://github.com/bats-core/bats-core.git /tmp/bats-core --depth=1 sudo /tmp/bats-core/install.sh /usr/local + - name: Install bats (macOS) + if: runner.os == 'macOS' + run: brew install bats-core + - name: Install bats (Windows) + if: runner.os == 'Windows' + run: | + git clone https://github.com/bats-core/bats-core.git "$HOME/bats-core" --depth=1 + echo "$HOME/bats-core/bin" >> "$GITHUB_PATH" - name: Build binary run: cargo build --release - name: Run e2e tests diff --git a/src/main.rs b/src/main.rs index 619a7b8..dd139bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,6 @@ use app_init::AppInitializer; use clap::{CommandFactory, Parser}; use clap_complete::generate; use cli_args::{AppArgs, Command}; -use std::io; use commands::{ add_command::AddCommand, file_forget_command::ForgetCommand, init_command::InitCommand, list_command::ListCommand, project_forget_command::ProjectForgetCommand, @@ -12,6 +11,7 @@ use commands::{ use config::{ app_config::AppConfigManager, locations::LocationsProvider, projects::ProjectsRetriever, }; +use std::io; use std::{env, path::Path}; mod app_init; @@ -134,6 +134,7 @@ fn run() -> Result<()> { )?; } }, + // handled up above Command::Completions { .. } => unreachable!(), }