Skip to content

Commit

Permalink
chore: use actions cargo of fmt and clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
baerwang committed Dec 26, 2023
1 parent b0e3e58 commit 9dc36b0
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: ci
on:
pull_request:
push:
branches: [ main ]

jobs:
format:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly
components: rustfmt

- name: Run fmt
run: cargo +nightly fmt --all -- --check --unstable-features

cargo-clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy

- uses: Swatinem/rust-cache@v2

- run: cargo clippy --all-targets --all-features --workspace -- -D warnings
19 changes: 19 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Rust

on:
push:
branches: [ main ]
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- run: cargo build --verbose

- run: cargo test --verbose

0 comments on commit 9dc36b0

Please sign in to comment.