Skip to content

Commit

Permalink
feat: add Rust check ci
Browse files Browse the repository at this point in the history
  • Loading branch information
SyMind committed Jan 3, 2024
1 parent 6ec4dee commit 74e2182
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,38 @@ env:
- docs/**
pull_request: null
jobs:
rust_check:
name: Rust check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2023-06-27
target: x86_64-unknown-linux-gnu

- name: Run Cargo Check
run: cargo check --workspace --all-targets --locked # Not using --release because it uses too much cache, and is also slow.

- name: Run Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --workspace --all-targets -- -D warnings

- name: Run rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

cargo-test:
name: Test cargo
runs-on: ubuntu-latest
needs:
- rust_check
steps:
- uses: actions/checkout@v3
- name: Install Rust
Expand Down
5 changes: 5 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[toolchain]
profile = "default"
# Use nightly for better access to the latest Rust features.
# This date is aligned to stable release dates.
channel = "nightly-2023-06-27"

0 comments on commit 74e2182

Please sign in to comment.