chore: Fill out missing docs and require them in CI #102
Workflow file for this run
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: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Run clippy | |
run: cargo clippy --all --all-targets -- -D warnings -D missing-docs | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v2 | |
with: | |
version: "23.3" | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Run rustdoc check | |
env: | |
RUSTDOCFLAGS: -D warnings | |
run: cargo doc | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Run fmt | |
run: cargo fmt -- --check | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Set up cargo cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | |
cargo-${{ hashFiles('**/Cargo.lock') }} | |
cargo- | |
- name: Run tests | |
run: cargo test --locked | |
test-minimal-versions: | |
runs-on: ubuntu-latest | |
name: test (minimal versions) | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Install nightly toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Generate Cargo.lock with minimal versions | |
run: | | |
rm Cargo.lock | |
cargo +nightly update -Zminimal-versions | |
# multistream-select 0.13 depends on log 0.4, however it can only | |
# compile with log 0.4.4 and above. When multistream-select 0.14 | |
# is released, this will not be needed. | |
cargo +nightly update -p log --precise 0.4.4 | |
- name: Install stable toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- name: Set up cargo cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
target/ | |
key: cargo-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | |
cargo-${{ hashFiles('**/Cargo.lock') }} | |
cargo- | |
- name: Run tests | |
run: cargo +stable test --locked | |
unused-deps: | |
runs-on: ubuntu-latest | |
name: unused dependencies | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Install toolchain | |
uses: dtolnay/rust-toolchain@nightly | |
- name: Install cargo-udeps | |
uses: taiki-e/cache-cargo-install-action@v1 | |
with: | |
tool: [email protected] | |
- name: Check for unused dependencies | |
run: cargo +nightly udeps --all-targets | |
env: | |
RUSTFLAGS: -D warnings |