From cd376f5dab0a290269d3dc798427a4ef5e483b92 Mon Sep 17 00:00:00 2001 From: ok300 <106775972+ok300@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:24:40 +0100 Subject: [PATCH 1/3] Add CI config --- .github/workflows/main.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..fe7a05148 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,29 @@ +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push events but only for the "main" branch + push: + branches: [ main ] + pull_request: + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + + fmt: + name: Cargo Format + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check Rust Formatting + run: | + cd lib + cargo fmt -- --check + cd ../cli + cargo fmt -- --check From 0afbe9c2951f8fedeac6879b8b3316e85e4a4d0d Mon Sep 17 00:00:00 2001 From: ok300 <106775972+ok300@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:27:22 +0100 Subject: [PATCH 2/3] Cargo fmt --- lib/src/wallet.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/wallet.rs b/lib/src/wallet.rs index f9cf360d2..6a6595ae2 100644 --- a/lib/src/wallet.rs +++ b/lib/src/wallet.rs @@ -15,7 +15,7 @@ use boltz_client::{ Bolt11Invoice, Keypair, }; use log::{debug, warn}; -use lwk_common::{Signer, Singlesig, singlesig_desc}; +use lwk_common::{singlesig_desc, Signer, Singlesig}; use lwk_signer::{AnySigner, SwSigner}; use lwk_wollet::{ elements::Address, full_scan_with_electrum_client, BlockchainBackend, ElectrumClient, @@ -23,8 +23,8 @@ use lwk_wollet::{ }; use crate::{ - Network, persist::Persister, OngoingSwap, SendPaymentResponse, SwapError, SwapLbtcResponse, WalletInfo, - WalletOptions, + persist::Persister, Network, OngoingSwap, SendPaymentResponse, SwapError, SwapLbtcResponse, + WalletInfo, WalletOptions, }; // To avoid sendrawtransaction error "min relay fee not met" From d67b0c7bd2e070ec71da37a03ed29d2a625ece39 Mon Sep 17 00:00:00 2001 From: ok300 <106775972+ok300@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:31:13 +0100 Subject: [PATCH 3/3] Add cargo clippy CI step --- .github/workflows/main.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fe7a05148..8d8576de3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,3 +27,15 @@ jobs: cargo fmt -- --check cd ../cli cargo fmt -- --check + + clippy: + name: Cargo Clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Check Rust Clippy + run: | + cd lib + cargo clippy -- -D warnings + cd ../cli + cargo clippy -- -D warnings \ No newline at end of file