mirror of
https://github.com/freemkv/freemkv-keysources.git
synced 2026-10-07 18:13:11 +00:00
Work now lands on dev and CI must be green there; main only moves at release time, to the tagged commit, so a push to main is the release validation run rather than day-to-day feedback. leak-guard already runs on every branch (on: [push, pull_request]) and release.yml stays tag-triggered, so neither needed a change.
40 lines
1.2 KiB
YAML
40 lines
1.2 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
# `dev` is where work lands and where CI must be green. `main` only ever
|
|
# moves at release time, to the tagged commit, so a push to it is the
|
|
# release validation run rather than day-to-day feedback.
|
|
branches: [main, dev]
|
|
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.97.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.97.0
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: freemkv-keysources-ci
|
|
- run: cargo test --locked
|