# SPDX-License-Identifier: MIT name: CI # Kept small: main and pull requests only, and a newer run on the same ref cancels the older # one. `cargo test` is rung 1 (ay8910-python's tests, transcribed, with its 19 conformance # examples) and the save-state test. Rungs 2 to 5 need the reference, ay8910-python, and run # locally (scripts/ladder.sh; docs/status.md). on: push: branches: [main] pull_request: concurrency: group: ci-${{ github.ref }} cancel-in-progress: true env: CARGO_TERM_COLOR: always jobs: build: name: fmt, clippy, test runs-on: ubuntu-latest timeout-minutes: 10 steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: components: rustfmt, clippy - name: Cache the registry and the build uses: actions/cache@v4 with: path: | ~/.cargo/registry ~/.cargo/git target key: cargo-${{ runner.os }}-${{ hashFiles('Cargo.lock') }} restore-keys: cargo-${{ runner.os }}- - run: cargo fmt --check - run: cargo clippy --release --all-targets --features serde -- -D warnings - run: cargo test --release - run: cargo test --release --features serde