From 93af96a524bb67a5e6fd18dcf6f790ff34d0aad7 Mon Sep 17 00:00:00 2001 From: benthecarman Date: Fri, 15 Sep 2023 17:48:20 -0500 Subject: [PATCH] Add CI --- .github/workflows/test.yml | 39 ++++++++++++++++++++++++++++++++++++++ src/bolt11.rs | 7 ++----- 2 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..d906d2a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,39 @@ +name: Tests + +on: + pull_request: + +jobs: + rust_tests: + name: Rust Checks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + components: clippy, rustfmt + override: true + profile: minimal + + - name: Setup trunk + uses: jetli/trunk-action@v0.1.0 + with: + version: 'latest' + + - uses: actions/cache@v2 + with: + path: | + ~/.cargo/registry + ~/.cargo/git + target + key: cargo-${{ runner.os }}-rust-tests-${{ hashFiles('**/Cargo.toml') }} + restore-keys: | + cargo-${{ runner.os }}-rust-tests- + cargo-${{ runner.os }}- + + - name: Check formatting + run: cargo fmt --check + + - name: Check clippy + run: cargo clippy diff --git a/src/bolt11.rs b/src/bolt11.rs index 0458c33..4854581 100644 --- a/src/bolt11.rs +++ b/src/bolt11.rs @@ -1,5 +1,5 @@ -use tonic_openssl_lnd::lnrpc; use serde::{Deserialize, Serialize}; +use tonic_openssl_lnd::lnrpc; use std::sync::{Arc, Mutex}; @@ -35,10 +35,7 @@ pub async fn request_bolt11( inv.value = amt as i64; } - let response = lightning_client - .add_invoice(inv) - .await? - .into_inner(); + let response = lightning_client.add_invoice(inv).await?.into_inner(); response.payment_request };