mirror of
https://github.com/freemkv/freemkv-unlock.git
synced 2026-10-07 18:13:11 +00:00
dev is where work lands and is meant to be pushed to often, so what runs there should be the cheap answer to "did I break it": lint, tests and the Linux build. The macOS and Windows jobs now run on qa and main instead of on every push to dev. Nothing is deleted and no platform goes unchecked before a release. qa.yml already covers macOS and Windows independently, and the jobs that live only here -- the Intel macOS build, the Windows release build -- still run, on the branches where a cross-platform break is worth blocking on. They are SKIPPED on dev via `if`, not left unscheduled. A queued job would be worse than a slow one: release.sh's CI gate refuses while any run for the commit is still in progress, so a job that never gets a runner blocks releases silently, with no error anywhere. That is the failure the real-media note in qa.yml describes, and it is why this is an `if` on the job rather than a narrower set of trigger branches.
99 lines
4.3 KiB
YAML
99 lines
4.3 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
# dev -> qa -> main. `dev` is where work lands and is meant to be pushed
|
|
# to often: these are the FAST checks, so a mistake surfaces in minutes.
|
|
# `qa` is the release candidate — it runs these too, plus the expensive
|
|
# suite in qa.yml. `main` only ever moves at release time, to a tagged
|
|
# commit that was already green on qa.
|
|
branches: [main, dev, qa]
|
|
pull_request:
|
|
|
|
# freemkv-unlock is the BASE of the whole ecosystem: libfreemkv path-deps it,
|
|
# bdemu path-deps it with the `emulation` feature, and every other crate pulls
|
|
# it in transitively. It has no freemkv dependencies of its own, so no sibling
|
|
# checkout is needed here — but it is also the crate whose breakage takes all
|
|
# seven others down with it, which is why it gets the full OS matrix rather
|
|
# than a token Linux run.
|
|
#
|
|
# Cargo.lock is gitignored (library convention), so `--locked` is deliberately
|
|
# NOT used: with no committed lockfile it fails rather than resolves.
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@1.97.0
|
|
with:
|
|
components: clippy, rustfmt
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: freemkv-unlock-ci
|
|
- run: cargo fmt --check
|
|
# --all-targets so the test code is linted too, not just the library.
|
|
- run: cargo clippy --all-targets -- -D warnings
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@1.97.0
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: freemkv-unlock-ci
|
|
- run: cargo test --tests
|
|
# `emulation` is off by default and is the face bdemu builds against. A
|
|
# feature nothing compiles is a feature that breaks at release time.
|
|
- run: cargo test --tests --features emulation
|
|
|
|
# The crate ships on macOS and Windows through its consumers, so it has to
|
|
# compile there. Build the tests (not just `cargo check`) — that forces
|
|
# codegen and catches errors in test-only code, which `check` skips.
|
|
check-macos:
|
|
# dev is the FAST lane: this job still runs, but on the release-candidate
|
|
# branches rather than on every push to dev. Nothing is deleted and no
|
|
# platform stops being checked before a release -- qa.yml independently
|
|
# covers macOS and Windows, and the jobs unique to this file (the Intel
|
|
# macOS build, the Windows release build) run here on qa and main. A push
|
|
# to dev is meant to be cheap and frequent; waiting on three runner pools
|
|
# to agree is what a release candidate is for.
|
|
#
|
|
# `if` SKIPS the job (it does not queue). A queued job would be far worse
|
|
# than a slow one: release.sh's CI gate refuses while any run for the
|
|
# commit is still in progress, so a never-scheduled job blocks releases
|
|
# silently -- see the note on real-media in qa.yml.
|
|
if: github.ref_name == 'qa' || github.ref_name == 'main'
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@1.97.0
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: freemkv-unlock-ci
|
|
- run: cargo build --tests --all-features
|
|
|
|
check-windows:
|
|
# dev is the FAST lane: this job still runs, but on the release-candidate
|
|
# branches rather than on every push to dev. Nothing is deleted and no
|
|
# platform stops being checked before a release -- qa.yml independently
|
|
# covers macOS and Windows, and the jobs unique to this file (the Intel
|
|
# macOS build, the Windows release build) run here on qa and main. A push
|
|
# to dev is meant to be cheap and frequent; waiting on three runner pools
|
|
# to agree is what a release candidate is for.
|
|
#
|
|
# `if` SKIPS the job (it does not queue). A queued job would be far worse
|
|
# than a slow one: release.sh's CI gate refuses while any run for the
|
|
# commit is still in progress, so a never-scheduled job blocks releases
|
|
# silently -- see the note on real-media in qa.yml.
|
|
if: github.ref_name == 'qa' || github.ref_name == 'main'
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v7
|
|
- uses: dtolnay/rust-toolchain@1.97.0
|
|
- uses: Swatinem/rust-cache@v2
|
|
with:
|
|
shared-key: freemkv-unlock-ci
|
|
- run: cargo build --tests --all-features
|