v0.2.0 #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
# Avoid duplicate builds on PRs. | |
branches: | |
- main | |
pull_request: | |
jobs: | |
check_publishable: | |
runs-on: ubuntu-22.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-22.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-22.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 |