name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: fmt + clippy + test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.lock') }}
- name: rustfmt
run: cargo fmt --check
- name: clippy (default / pure Rust)
run: cargo clippy --all-targets -- -D warnings
- name: clippy (ffi + bindgen)
run: cargo clippy --all-targets --features bindgen -- -D warnings
- name: tests (default / pure Rust)
run: cargo test
- name: tests (ffi)
run: cargo test --features ffi
- name: benches compile
run: cargo bench --no-run
- name: Swift bindings drift check
run: |
cargo run --features bindgen --bin uniffi-bindgen generate src/cindermark.udl \
--language swift --no-format --out-dir /tmp/bindings-check
diff -u swift/Sources/Cindermark/CindermarkFFI.swift /tmp/bindings-check/CindermarkFFI.swift \
|| { echo "::error::Committed Swift bindings are stale. Regenerate with uniffi-bindgen (see CONTRIBUTING.md)."; exit 1; }