Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
bennyhodl committed Oct 30, 2024
1 parent f68a936 commit 7f236da
Show file tree
Hide file tree
Showing 4 changed files with 71 additions and 1 deletion.
63 changes: 63 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Format, clippy, and test dlcdevkit
#
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always

jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- name: Install Protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: clippy
override: true
- name: Check clippy
run: cargo clippy -- -D warnings
fmt_check:
runs-on: ubuntu-latest
steps:
- name: Install Protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt
override: true
- name: Check format
run: cargo fmt --check

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Install just
uses: extractions/setup-just@v1

- name: Install Protoc
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler

- uses: actions-rs/toolchain@v1
with:
toolchain: stable

- name: Start dependencies
run: just ci-deps

- name: Setup Bitcoin Node
run: |
docker logs bitcoin
chmod +x ./testconfig/scripts/setup-bitcoind.sh
./testconfig/scripts/setup-bitcoind.sh
- name: Run tests
run: cargo test --all-features --verbose

- name: Stop dependencies
run: just deps-down
1 change: 1 addition & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignore = ["ddk-node/src/ddkrpc.rs"]
5 changes: 4 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
deps:
- docker compose --profile "*" up -d

ci-deps:
- docker compose up -d

kormir:
- {{justfile_directory()}}/testconfig/use-kormir.sh

bc *args:
- docker exec -it bitcoin bitcoin-cli --rpcport=18443 --rpcuser=ddk --rpcpassword=ddk -rpcwallet=ddk {{args}}
- docker exec bitcoin bitcoin-cli --rpcport=18443 --rpcuser=ddk --rpcpassword=ddk -rpcwallet=ddk {{args}}

node-one:
- cargo run --bin ddk-node
Expand Down
3 changes: 3 additions & 0 deletions testconfig/scripts/setup-bitcoind.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
just bc createwallet testrunner
just bc -generate 250

0 comments on commit 7f236da

Please sign in to comment.