From d1a4ec9a3fd3045845b14434f5bf89cab1e06d49 Mon Sep 17 00:00:00 2001 From: Matthew Jackson Date: Thu, 25 Jun 2026 17:58:30 -0700 Subject: [PATCH] ci: add CI workflow (fmt + clippy -D warnings + test on Rust 1.86) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The crate previously had only leak-guard.yml and release.yml, so its ~42 tests never ran on push/PR — only on tag. Mirror the sibling crates' ci.yml (lint + test jobs, dtolnay/rust-toolchain@1.86.0, rust-cache). No --locked: this library does not track Cargo.lock (release.yml notes --locked would fail on a fresh runner). --- .github/workflows/ci.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..30e0fa3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + +# freemkv-keysources depends on libfreemkv from crates.io (see Cargo.toml). +# No sibling-repo checkout is needed. + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: dtolnay/rust-toolchain@1.86.0 + with: + components: clippy, rustfmt + # Cache ~/.cargo/registry + target/ across runs. Saves ~30-60s + # of crates.io index download per job; incremental compilation + # helps on re-runs that don't bump Cargo.lock. + - uses: Swatinem/rust-cache@v2 + with: + shared-key: freemkv-keysources-ci + - run: cargo fmt --check + - run: cargo clippy -- -D warnings + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + - uses: dtolnay/rust-toolchain@1.86.0 + - uses: Swatinem/rust-cache@v2 + with: + shared-key: freemkv-keysources-ci + - run: cargo test --locked