Refactor and clean the code #297
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: Code quality and sanity | |
on: | |
push: | |
branches: 'main' | |
pull_request: | |
branches: '*' | |
jobs: | |
clippy: | |
name: Lint with Clippy | |
runs-on: ubuntu-latest | |
env: | |
RUSTFLAGS: -Dwarnings | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Caching project dependencies | |
id: project-cache | |
uses: Swatinem/rust-cache@v2 | |
- uses: hecrj/setup-rust-action@v1 | |
with: | |
components: clippy | |
- name: Verifiying the code quality with Clippy | |
working-directory: zork++ | |
run: | | |
cargo clippy --all-targets --all-features | |
rustfmt: | |
name: Verify code formatting | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Caching project dependencies | |
id: project-cache | |
uses: Swatinem/rust-cache@v2 | |
- uses: hecrj/setup-rust-action@v2 | |
with: | |
components: rustfmt | |
- name: Checking the format sanity of the project | |
working-directory: zork++ | |
run: | | |
cargo fmt --all -- --check | |
unit-and-doc-tests: | |
name: Run unit and doc tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Caching project dependencies | |
id: project-cache | |
uses: Swatinem/rust-cache@v2 | |
- uses: hecrj/setup-rust-action@v2 | |
with: | |
components: rustfmt | |
- name: Run Unit and Doc tests | |
working-directory: zork++ | |
run: | | |
cargo test --workspace --lib --color=always --no-fail-fast | |
cargo test --workspace --doc --color=always --no-fail-fast |