Fixed lint warnings #64
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 ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
runs-on: ${{matrix.os}} | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
name: macos_x86_64 | |
target: x86_64-apple-darwin | |
- os: ubuntu-latest | |
name: linux_x86_64 | |
target: x86_64-unknown-linux-gnu | |
- os: windows-latest | |
name: windows_x86_64 | |
target: x86_64-pc-windows-msvc | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install rust version | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
target: ${{matrix.target}} | |
- uses: actions/checkout@v4 | |
- name: Run tests | |
run: cargo test --verbose --release --all-features | |
rustfmt: | |
name: Rustfmt | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Rust toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
components: rustfmt | |
- name: Cache build artifacts | |
uses: Swatinem/rust-cache@v2.7.0 | |
- name: Check code formatted | |
run: cargo fmt -- --check | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup Rust toolchain | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
components: clippy | |
- name: Cache build artifacts | |
uses: Swatinem/rust-cache@v2.7.0 | |
- name: Check no lint warnings | |
run: cargo clippy -- -D warnings | |
- name: Check no lint warnings (all features) | |
run: cargo clippy --all-features -- -D warnings | |
- name: Check no lint warnings (no default features) | |
run: cargo clippy --no-default-features -- -D warnings |