Skip to content

Commit

Permalink
Add rust linting github workflow (#674)
Browse files Browse the repository at this point in the history
* add rust lint workflows

* add cargo-deny config file

* update lockfile

* add license to rust package

* fix formatting

---------

Co-authored-by: daniel.eades <[email protected]>
  • Loading branch information
danieleades and daniel.eades authored Dec 15, 2023
1 parent c5a8b5a commit 33a0436
Show file tree
Hide file tree
Showing 5 changed files with 261 additions and 107 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
on:
push:
branches: [main]
pull_request:

name: Rust Continuous integration

defaults:
run:
working-directory: ./server

jobs:

# test:
# name: test
# runs-on: ${{ matrix.os }}
# strategy:
# matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
# toolchain: [stable]
# include:
# - os: ubuntu-latest
# toolchain: nightly
# steps:
# - uses: actions/checkout@v4
# - uses: dtolnay/rust-toolchain@master
# with:
# toolchain: ${{ matrix.toolchain }}
# - run: cargo test --all-features

fmt:
name: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --all --check

clippy:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2023-12-10
components: clippy
- uses: actions-rs-plus/clippy-check@v2
with:
working-directory: server/
args: --all-features --all-targets

docs:
name: docs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo doc --no-deps

cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
with:
arguments: --manifest-path server/Cargo.toml
Loading

0 comments on commit 33a0436

Please sign in to comment.