From 5d254c7ecac40e46d1d7d2659090210253607722 Mon Sep 17 00:00:00 2001 From: Jason Hall Date: Sat, 7 Jun 2025 22:03:28 -0400 Subject: [PATCH] Add tests to pre-commit hooks and simplify CI matrix - Add cargo test and e2e tests to pre-commit hooks - Temporarily disable macOS CI to focus on Linux - Ensure all tests pass locally before committing --- .github/workflows/ci.yml | 14 +------------- .pre-commit-config.yaml | 14 ++++++++++++++ tests/integration_test.rs | 1 - 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac0096f..775ae5f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest] rust: [stable, beta] steps: - uses: actions/checkout@v4 @@ -30,18 +30,6 @@ jobs: run: | sudo apt-get update sudo apt-get install -y musl-tools - - name: Install cross-compilation tools (macOS) - if: matrix.os == 'macos-latest' - run: | - # Install musl-cross from the correct tap - brew install messense/macos-cross-toolchains/x86_64-unknown-linux-musl - # Set up cargo config for cross-compilation - mkdir -p ~/.cargo - echo '[target.x86_64-unknown-linux-musl]' >> ~/.cargo/config.toml - echo 'linker = "x86_64-unknown-linux-musl-gcc"' >> ~/.cargo/config.toml - - name: Set up Docker (macOS) - if: matrix.os == 'macos-latest' - uses: douglascamata/setup-docker-macos-action@v1-alpha - name: Cache cargo registry uses: actions/cache@v4 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 36dbf5c..dfc5b7b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,6 +23,20 @@ repos: types: [rust] pass_filenames: false + - id: cargo-test + name: cargo test + entry: cargo test + language: system + types: [rust] + pass_filenames: false + + - id: cargo-test-e2e + name: cargo e2e tests + entry: cargo test --test '*' + language: system + types: [rust] + pass_filenames: false + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.5.0 hooks: diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 37e7d39..6d8da45 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -131,7 +131,6 @@ fn test_verbose_logging() -> Result<()> { } #[test] -#[cfg_attr(not(ci), ignore)] // Run in CI, but allow skipping locally fn test_full_build_and_run_workflow() -> Result<()> { // This test requires Docker let docker_check = StdCommand::new("docker").arg("version").output();