Skip to content

Commit

Permalink
Added rustfmt to CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
kisialiou committed Oct 21, 2024
1 parent e1f708c commit a3214df
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/lints.yaml → .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ on:
branches: [ main, develop ]

jobs:
clippy:
lint:
runs-on: ubuntu-latest
strategy:
matrix:
component: [near]
check: [clippy, fmt]
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -20,13 +21,13 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: 1.79.0
components: clippy
components: clippy, rustfmt
target: wasm32-unknown-unknown
override: true

- name: Run Clippy
- name: Run ${{ matrix.check }}
run: |
make rust-lint-${{ matrix.component }}
make ${{ matrix.check }}-${{ matrix.component }}
build:
runs-on: ubuntu-latest
Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@ RUSTFLAGS = -C link-arg=-s
NEAR_MANIFEST = ./near/Cargo.toml
OMNI_RELAYER_MANIFEST = ./omni-relayer/Cargo.toml

rust-lint: rust-lint-near #rust-lint-relayer
clippy: clippy-near #clippy-relayer

rust-lint-near:
clippy-near:
cargo clippy --manifest-path $(NEAR_MANIFEST) -- $(LINT_OPTIONS)

rust-lint-omni-relayer:
fmt-near:
cargo fmt --all --check --manifest-path $(NEAR_MANIFEST)

fmt-omni-relayer:
cargo fmt --all --check --manifest-path $(OMNI_RELAYER_MANIFEST)

clippy-omni-relayer:
cargo clippy --manifest-path $(OMNI_RELAYER_MANIFEST) -- $(LINT_OPTIONS)

rust-build-near:
Expand Down

0 comments on commit a3214df

Please sign in to comment.