-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CI for Rust tests, clippy, fmt (#65)
* Add CI for Rust tests, clippy, fmt * Rename GH task to Rust
- Loading branch information
1 parent
3b429fa
commit 257d890
Showing
3 changed files
with
77 additions
and
360 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Rust | ||
|
||
on: push | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
RUST_TOOLCHAIN: 1.80.1 | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust toolchain | ||
uses: moonrepo/setup-rust@v1 | ||
with: | ||
channel: ${{ env.RUST_TOOLCHAIN }} | ||
|
||
- name: Run tests | ||
# Ensure debug output is also tested | ||
env: | ||
RUST_LOG: debug | ||
run: cargo test --all-features | ||
|
||
check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust toolchain | ||
uses: moonrepo/setup-rust@v1 | ||
with: | ||
channel: ${{ env.RUST_TOOLCHAIN }} | ||
|
||
- name: Check project and dependencies | ||
run: cargo check | ||
|
||
fmt: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust toolchain | ||
uses: moonrepo/setup-rust@v1 | ||
with: | ||
components: rustfmt | ||
channel: ${{ env.RUST_TOOLCHAIN }} | ||
|
||
- name: Check formatting | ||
run: cargo fmt -- --check | ||
|
||
clippy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Rust toolchain | ||
uses: moonrepo/setup-rust@v1 | ||
with: | ||
components: clippy | ||
channel: ${{ env.RUST_TOOLCHAIN }} | ||
|
||
- name: Check code with clippy | ||
run: cargo clippy -- -D warnings --no-deps |
Oops, something went wrong.