Skip to content

Commit 73da722

Browse files
authored
Merge pull request #2861 from tnull/2024-01-introduce-cargo-audit
Introduce CI workflow running `cargo audit`
2 parents f98a652 + fd705c7 commit 73da722

File tree

6 files changed

+37
-21
lines changed

6 files changed

+37
-21
lines changed

.github/workflows/audit.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Security Audit
2+
on:
3+
workflow_dispatch:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
7+
jobs:
8+
audit:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
checks: write
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: rustsec/[email protected]
16+
with:
17+
token: ${{ secrets.GITHUB_TOKEN }}

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ members = [
1010
"lightning-background-processor",
1111
"lightning-rapid-gossip-sync",
1212
"lightning-custom-message",
13+
"lightning-transaction-sync",
1314
]
1415

1516
exclude = [
16-
"lightning-transaction-sync",
1717
"no-std-check",
1818
"msrv-no-dev-deps-check",
1919
"bench",

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ Rust-Lightning
44
[![Crate](https://img.shields.io/crates/v/lightning.svg?logo=rust)](https://crates.io/crates/lightning)
55
[![Documentation](https://img.shields.io/static/v1?logo=read-the-docs&label=docs.rs&message=lightning&color=informational)](https://docs.rs/lightning/)
66
[![Safety Dance](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance/)
7+
[![Security Audit](https://github.com/lightningdevkit/rust-lightning/actions/workflows/audit.yml/badge.svg)](https://github.com/lightningdevkit/rust-lightning/actions/workflows/audit.yml)
78

8-
[LDK](https://lightningdevkit.org)/`rust-lightning` is a highly performant and flexible
9+
[LDK](https://lightningdevkit.org)/`rust-lightning` is a highly performant and flexible
910
implementation of the Lightning Network protocol.
1011

1112
The primary crate, `lightning`, is runtime-agnostic. Data persistence, chain interactions,

ci/ci-tests.sh

+14-16
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,14 @@ PIN_RELEASE_DEPS # pin the release dependencies in our main workspace
6363
# The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
6464
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p backtrace --precise "0.3.68" --verbose
6565

66+
# Starting with version 0.5.9 (there is no .6-.8), the `home` crate has an MSRV of rustc 1.70.0.
67+
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p home --precise "0.5.5" --verbose
68+
6669
export RUST_BACKTRACE=1
6770

71+
# Build `lightning-transaction-sync` in no_download mode.
72+
export RUSTFLAGS="$RUSTFLAGS --cfg no_download"
73+
6874
echo -e "\n\nBuilding and testing all workspace crates..."
6975
cargo test --verbose --color always
7076
cargo check --verbose --color always
@@ -85,24 +91,16 @@ if [[ "$HOST_PLATFORM" != *windows* ]]; then
8591
echo -e "\n\nBuilding and testing Transaction Sync Clients with features"
8692
pushd lightning-transaction-sync
8793

88-
# reqwest 0.11.21 had a regression that broke its 1.63.0 MSRV
89-
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p reqwest --precise "0.11.20" --verbose
90-
# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
91-
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose
92-
# Starting with version 0.5.9 (there is no .6-.8), the `home` crate has an MSRV of rustc 1.70.0.
93-
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p home --precise "0.5.5" --verbose
94-
9594
DOWNLOAD_ELECTRS_AND_BITCOIND
9695

97-
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo test --verbose --color always --features esplora-blocking
98-
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo check --verbose --color always --features esplora-blocking
99-
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo test --verbose --color always --features esplora-async
100-
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo check --verbose --color always --features esplora-async
101-
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo test --verbose --color always --features esplora-async-https
102-
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo check --verbose --color always --features esplora-async-https
103-
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo test --verbose --color always --features electrum
104-
RUSTFLAGS="$RUSTFLAGS --cfg no_download" cargo check --verbose --color always --features electrum
105-
96+
cargo test --verbose --color always --features esplora-blocking
97+
cargo check --verbose --color always --features esplora-blocking
98+
cargo test --verbose --color always --features esplora-async
99+
cargo check --verbose --color always --features esplora-async
100+
cargo test --verbose --color always --features esplora-async-https
101+
cargo check --verbose --color always --features esplora-async-https
102+
cargo test --verbose --color always --features electrum
103+
cargo check --verbose --color always --features electrum
106104
popd
107105
fi
108106

lightning-transaction-sync/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ electrum-client = { version = "0.18.0", optional = true }
3434
lightning = { version = "0.0.121", path = "../lightning", default-features = false, features = ["std", "_test_utils"] }
3535
tokio = { version = "1.35.0", features = ["full"] }
3636

37-
[target.'cfg(not(no_download))'.dev-dependencies]
37+
[target.'cfg(all(not(target_os = "windows"), not(no_download)))'.dev-dependencies]
3838
electrsd = { version = "0.26.0", default-features = false, features = ["legacy", "esplora_a33e97e1", "bitcoind_25_0"] }
3939

40-
[target.'cfg(no_download)'.dev-dependencies]
40+
[target.'cfg(all(not(target_os = "windows"), no_download))'.dev-dependencies]
4141
electrsd = { version = "0.26.0", default-features = false, features = ["legacy"] }

lightning-transaction-sync/tests/integration_tests.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg(any(feature = "esplora-blocking", feature = "esplora-async", feature = "electrum"))]
1+
#![cfg(all(not(target_os = "windows"), any(feature = "esplora-blocking", feature = "esplora-async", feature = "electrum")))]
22

33
#[cfg(any(feature = "esplora-blocking", feature = "esplora-async"))]
44
use lightning_transaction_sync::EsploraSyncClient;

0 commit comments

Comments
 (0)