Add clippy CI check to workflow #249
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: cargo | |
on: [pull_request] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
# check workspace for warnings & treat them as errors | |
clippy: | |
name: clippy | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install dev-dependencies | |
run: sudo apt-get install -y libxcb-shape0-dev libxcb-xfixes0-dev | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install stable toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
override: true | |
- name: cargo clippy | |
uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-features --all-targets -- -D warnings | |
# check if workspace is formatted, and treat unformatted code as errors. | |
fmt-check: | |
name: fmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install toolchain | |
uses: dsherret/rust-toolchain-file@v1 | |
- name: Check Formatting | |
run: cargo fmt --all -- --check | |
- name: Install taplo-cli | |
uses: baptiste0928/cargo-install@v2.2.0 | |
with: | |
crate: taplo-cli | |
- name: Run taplo linter | |
run: taplo format --check --verbose | |
cargo-test-workspace: | |
name: test workspace crates | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install toolchain | |
uses: dsherret/rust-toolchain-file@v1 | |
- name: Test Workspace | |
run: cargo test --workspace --features mock_storage |