Skip to content

Commit

Permalink
Added rustfmt and clippy on the CI. Closed #38
Browse files Browse the repository at this point in the history
  • Loading branch information
dyz1990 committed Oct 22, 2023
1 parent cc951fc commit c8e27b7
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,39 @@ jobs:
- 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

0 comments on commit c8e27b7

Please sign in to comment.