Skip to content

Commit

Permalink
Fix CI-linting
Browse files Browse the repository at this point in the history
  • Loading branch information
richardpringle committed Dec 5, 2023
1 parent 3be8192 commit 2873546
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ permissions:
contents: write

jobs:
unit:
name: lint
fmt:
runs-on: ubuntu-latest
steps:
- name: Remove unnecessary files
Expand All @@ -38,4 +37,30 @@ jobs:
uses: actions/checkout@v3
- name: Run static analysis tests
shell: bash
run: scripts/tests.lint.sh
run: cargo fmt --all --check
clippy:
runs-on: ubuntu-latest
steps:
- name: Remove unnecessary files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Install linker
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gcc-multilib
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Check Rust version
run: rustc --version
- name: Install protoc
uses: arduino/setup-protoc@v1
with:
version: "3.x"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- name: Run static analysis tests
shell: bash
run: cargo clippy --all --all-features --tests --benches --examples
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ members = [
default-members = ["crates/avalanche-types", "crates/avalanche-consensus"]
resolver = "2"

[workspace.lints.clippy]
# suspicious = "deny"
# style = "deny"
# complexity = "deny"
# perf = "deny"
# pedantic = "deny"
# restriction = "deny"
# nursery = "deny"
# cargo = "deny"

[workspace.package]
version = "0.1.1"
authors = ["gyuho", "hexfusion", "exdx", "richardpringle"]
Expand Down
3 changes: 3 additions & 0 deletions crates/avalanche-consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ license-file = "LICENSE"
homepage = "https://avax.network"
repository = "https://github.com/ava-labs/avalanche-rs/tree/main/crates/avalanche-consensus"

[lints]
workspace = true

[dependencies]
avalanche-types = { version = "0.1.1", path = "../../crates/avalanche-types", features = [] } # https://crates.io/crates/avalanche-types
bytes = "1.4.0"
Expand Down
3 changes: 3 additions & 0 deletions crates/avalanche-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ homepage = "https://avax.network"
repository = "https://github.com/ava-labs/avalanche-rs/tree/main/crates/avalanche-types"
readme = "README.md"

[lints]
workspace = true

[dependencies]
async-trait = "0.1.73" # for "key::secp256k1" sign trait, https://github.com/dtolnay/async-trait
bech32 = "0.9.1"
Expand Down

0 comments on commit 2873546

Please sign in to comment.