# Formatting, lints and the dependencies, as `just lint` checks the Rust, on # every pull and push to main; test.yml runs the tests. On a pull, that a # change people see comes with a change file (harness/changes.sh). # # The image is the Rust `just lint` runs locally, so a newer release's new # lints land on purpose. The build, the toolchain's components and # cargo-deny are kept between runs, so a push lints only what it changed. image: rust:1.100 # The shared runner host, as every workflow here. runners: [runner.knotless.dev] # A pre-flight: the merge queue takes a pull into a batch only once this # has passed at its head, so one that does not build fails no batch. queue: first on: push: {refs: [refs/heads/main]} pull: {base: [refs/heads/main, refs/heads/feature/*]} cache: [target, /usr/local/cargo/registry, /usr/local/rustup, /opt/cargo-deny] env: # The image's version: the cached /usr/local/rustup hides the image's own # and keeps the default of the first image that filled it, so rustup # installs this one into the cache on the first run that names it. RUSTUP_TOOLCHAIN: "1.100.0" steps: # cargo fmt --check, then clippy over the workspace, warnings denied. - uses: chadtmiller.com/steps/rust-lint@1 # The dependencies' advisories, licences, bans and sources (deny.toml). # The advisories are RustSec's as they are at the run, so a new one can # fail a push that changed nothing. - name: deny run: | v=0.22.0 /opt/cargo-deny/bin/cargo-deny --version 2>/dev/null | grep -qx "cargo-deny $v" || cargo install --locked --force --version "$v" --root /opt/cargo-deny cargo-deny /opt/cargo-deny/bin/cargo-deny check - name: changes run: harness/changes.sh