Skip to content

Commit

Permalink
ci: run clippy in nightly rust
Browse files Browse the repository at this point in the history
  • Loading branch information
xJonathanLEI committed Mar 27, 2024
1 parent 257e5f3 commit 2e2bf3f
Showing 1 changed file with 48 additions and 18 deletions.
66 changes: 48 additions & 18 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
on:
push:
branches:
- master
- "master"
pull_request:

name: Linting
name: "Linting"

jobs:
lint:
name: Lints
runs-on: ubuntu-latest
format:
name: "Check code format"
runs-on: "ubuntu-latest"
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Use Rust cache
uses: Swatinem/rust-cache@v1
- name: "Checkout source code"
uses: "actions/checkout@v3"

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

- name: "Install prettier"
run: |
yarn global add prettier
- name: Install black
- name: "Install black"
run: |
pip install git+https://github.com/psf/black
- name: Check Markdown format
- name: "Check Markdown format"
run: |
prettier --check "**/*.md"
- name: Check Yaml format
- name: "Check Yaml format"
run: |
prettier --check "**/*.{yaml,yml}"
- name: Check JSON format
- name: "Check JSON format"
run: |
EXIT_CODE="0";
readarray -d '' FILES < <(find -type f -name "*.json" -not -path "./target/*");
Expand All @@ -43,16 +49,40 @@ jobs:
fi
done
exit $EXIT_CODE;
- name: Check Python format
- name: "Check Python format"
run: |
black --check .
- name: Check Rust format
- name: "Check Rust format"
run: |
cargo fmt --all -- --check
- name: Run Clippy lints
clippy:
name: "Run Clippy"
runs-on: "ubuntu-latest"

strategy:
matrix:
toolchain:
- "stable"
- "nightly"
steps:
- name: "Checkout source code"
uses: "actions/checkout@v3"

- name: "Setup toolchain"
uses: "actions-rs/toolchain@v1"
with:
toolchain: "${{ matrix.toolchain }}"
components: "clippy"
override: true

- name: "Run Clippy (default)"
run: |
cargo clippy --all --all-targets -- -D warnings
- name: Run Clippy lints (no_std)
- name: "Run Clippy (no_std)"
run: |
cargo clippy --package starknet-crypto --no-default-features -- -D warnings
cargo clippy --package starknet-crypto --no-default-features --features alloc -- -D warnings

0 comments on commit 2e2bf3f

Please sign in to comment.