Fix clippy lints #1067
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: Rust | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install rustfmt | |
run: rustup component add rustfmt | |
- name: Check Formatting | |
run: cargo fmt --all -- --check | |
feature-check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Protobuf Compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Install Rust Stable | |
run: rustup default stable | |
- name: Install cargo-hack | |
uses: taiki-e/install-action@v2 | |
with: | |
tool: cargo-hack | |
- name: Check Feature Matrix | |
run: cargo hack check --all --all-targets --feature-powerset --release | |
test: | |
name: Test (rust-toolchain.toml) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Protobuf Compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Install Rust Stable | |
run: rustup default stable | |
- name: Run Tests | |
run: cargo test --all-features --workspace | |
test-matrixed: | |
name: Test ${{ matrix.rust_version }} | |
runs-on: ubuntu-latest | |
strategy: | |
# 1.70 is the MSRV for the project, which currently does not match the version specified in | |
# the rust-toolchain.toml file as metrics-observer requires 1.74 to build. See | |
# https://github.com/metrics-rs/metrics/pull/505#discussion_r1724092556 for more information. | |
matrix: | |
rust_version: ['stable', 'nightly', '1.70'] | |
include: | |
- rust_version: '1.70' | |
exclude-packages: '--exclude metrics-observer' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Protobuf Compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Install Rust ${{ matrix.rust_version }} | |
run: rustup install ${{ matrix.rust_version }} | |
- name: Run Tests | |
run: cargo +${{ matrix.rust_version }} test --all-features --workspace ${{ matrix.exclude-packages }} | |
docs: | |
runs-on: ubuntu-latest | |
env: | |
RUSTDOCFLAGS: -Dwarnings | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Protobuf Compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Install Rust Nightly | |
run: rustup install nightly | |
- name: Check Docs | |
run: cargo +nightly doc --all-features --workspace --no-deps | |
bench: | |
name: Bench | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Protobuf Compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Install Rust Stable | |
run: rustup default stable | |
- name: Run Benchmarks | |
run: cargo bench --all-features --workspace --exclude=metrics-observer --exclude=metrics-benchmark | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Protobuf Compiler | |
run: sudo apt-get install protobuf-compiler | |
- name: Install Rust Stable | |
run: rustup default stable | |
- name: Install Clippy | |
run: rustup component add clippy | |
- name: Run Clippy | |
run: cargo clippy --all-features --workspace --exclude=metrics-benchmark |