Skip to content

Commit

Permalink
ci: check format and lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Apr 10, 2024
1 parent 585c00d commit c79e9de
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
on:
push:
branches:
- "master"
pull_request:

name: "Linting"

jobs:
lint:
name: "Lints"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout source code"
uses: "actions/checkout@v3"

- name: "Setup stable toolchain"
uses: "actions-rs/toolchain@v1"
with:
toolchain: "stable"
profile: "minimal"
override: true

- name: "Use Rust cache"
uses: "Swatinem/rust-cache@v2"
with:
cache-on-failure: true

- name: "Install prettier"
run: |
yarn global add prettier
- name: "Check prettier format"
run: |
prettier --ignore-path .gitignore --check .
- name: "Check Rust format"
run: |
cargo fmt --all -- --check
- name: "Run Clippy lints"
run: |
cargo clippy --all --all-targets -- -D warnings

0 comments on commit c79e9de

Please sign in to comment.