Skip to content

Update style guide

Update style guide #10

Workflow file for this run

name: CI
on:
push:
# Avoid duplicate builds on PRs.
branches:
- main
pull_request:
jobs:
check_publishable:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
# Most of the time this will be a no-op, since GitHub releases new images every week
# which include the latest stable release of Rust, Rustup, Clippy and rustfmt.
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Check cargo publish
run: cargo publish --dry-run
lint:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
# Most of the time this will be a no-op, since GitHub releases new images every week
# which include the latest stable release of Rust, Rustup, Clippy and rustfmt.
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Clippy
# Using --all-targets so tests are checked and --deny to fail on warnings.
# Not using --locked here and below since Cargo.lock is in .gitignore.
run: cargo clippy --all-targets --all-features -- --deny warnings
- name: rustfmt
run: cargo fmt -- --check
- name: Check docs
# Using RUSTDOCFLAGS until `cargo doc --check` is stabilised:
# https://github.com/rust-lang/cargo/issues/10025
run: RUSTDOCFLAGS="-D warnings" cargo doc --all-features --document-private-items --no-deps
unit-test:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Update Rust toolchain
run: rustup update
- name: Rust Cache
uses: Swatinem/[email protected]
- name: Run unit tests
run: cargo test --all-features