Skip to content

Commit

Permalink
Merge pull request #1 from ChainSafe/willem/rust-builds-in-ci
Browse files Browse the repository at this point in the history
Add rust fmt, clippy and check running in CI
  • Loading branch information
willemolding authored Aug 12, 2024
2 parents 5b57fbc + 0294577 commit a37765e
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/rust-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Rust-Checks

on:
pull_request:
push:
branches: main

jobs:
fmt:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Rust toolchain
uses: ./.github/actions/install-rust-toolchain
with:
components: rustfmt

- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

clippy:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install Rust toolchain
uses: ./.github/actions/install-rust-toolchain
with:
components: clippy

- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all --all-targets -- -D warnings
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// SPDX-License-Identifier: Apache-2.0, MIT

//! This is the top level documentation!
#![allow(async_fn_in_trait)]

pub mod account;
pub mod error;
Expand Down
2 changes: 1 addition & 1 deletion src/store/injected_store.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2024 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

use crate::store::WalletStore;
use crate::error::Error;
use crate::store::WalletStore;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(typescript_custom_section)]
Expand Down
2 changes: 1 addition & 1 deletion src/store/memory_store.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2024 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0, MIT

use crate::store::WalletStore;
use crate::error::Error;
use crate::store::WalletStore;

/// A simple in-memory store for wallet data. Useful for testing
pub struct MemoryStore {
Expand Down
2 changes: 1 addition & 1 deletion tests/web_accounts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ use webz_core::account::Account;
#[wasm_bindgen_test]
fn test_account_from_seed() {
let seed = [0; 32];
let a = Account::from_seed(&seed, 0).unwrap();
let _a = Account::from_seed(&seed, 0).unwrap();
}

0 comments on commit a37765e

Please sign in to comment.