update ci on #4
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: | |
pull_request: | |
push: | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_TOOLCHAIN: stable | |
# Sparse cargo registry for faster updates | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.CARGO_TOOLCHAIN }} | |
- name: Cache Cargo build files | |
uses: Leafwing-Studios/cargo-cache@v1 | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
- name: Run cargo test | |
run: cargo test | |
doc: | |
runs-on: ubuntu-latest | |
env: | |
RUSTDOCFLAGS: "-D warnings" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.CARGO_TOOLCHAIN }} | |
- name: Cache Cargo build files | |
uses: Leafwing-Studios/cargo-cache@v1 | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
- name: Run cargo doc | |
run: cargo doc --no-deps --document-private-items | |
lint: | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: "-D warnings" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: ${{ env.CARGO_TOOLCHAIN }} | |
components: rustfmt, clippy | |
- name: Cache Cargo build files | |
uses: Leafwing-Studios/cargo-cache@v1 | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
- name: Check format | |
run: cargo fmt --all -- --check | |
- name: Run clippy with dev features | |
run: cargo clippy | |
- name: Run clippy without dev features | |
run: cargo clippy --no-default-features |