-
Notifications
You must be signed in to change notification settings - Fork 4
Add Github workflows for test, fmt, clippy, PR and Issue templates #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
1a163f9 to
30ca521
Compare
30ca521 to
6e9730c
Compare
oleonardolima
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, I just left a few comments.
I think we can only commit the Cargo.lock once it's final, and moved to corepc repository. WDYT ?
| - name: Generate cache key | ||
| shell: bash | ||
| run: echo "${{ matrix.rust }} ${{ matrix.features }}" | tee .cache_key | ||
|
|
||
| - name: Cache cargo registry | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cargo/registry | ||
| key: ${{ runner.os }}-${{ matrix.rust }}-cargo-registry-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.lock') }} | ||
|
|
||
| - name: Cache cargo index | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: ~/.cargo/git | ||
| key: ${{ runner.os }}-${{ matrix.rust }}-cargo-index-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.lock') }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a better idea to follow the same CI approach as bdk_wallet, and use the actions-rust-lang/setup-rust-toolchain@v1 and it can handle all the cache and rust toolchain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to follow the same CI as corepc ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to follow the same CI as corepc ?
No, it wasn't. I used the approach we used in bdk-cli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, got it. I'll test the CI on my fork and see how it goes.
I don't mean to bikeshed on this PR, and we can update the CI to follow either bdk-wallet or bdk ones in a follow-up (if this already unblocks you for upcoming PRs).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tvpeter Oh, you pushed a new commit as I was reviewing 😁. Let me know again when it's ready for review or my suggestions are not applicable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tvpeter Oh, you pushed a new commit as I was reviewing 😁. Let me know again when it's ready for review or my suggestions are not applicable.
Oh apologies, I was addressing your yesterday's comments. Let me update to include the latest comments and will re-request a review. Thank you
Cargo.toml
Outdated
|
|
||
| [features] | ||
| default = [ "v30" ] | ||
| v30 = [ ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: you can follow the same way as corepc: 30_0
- harmonize all actions to use actions-rust-lang/ setup-rust-toolchain with auto-caching
| - name: Install Bitcoin Core 27.0 | ||
| run: | | ||
| wget https://bitcoincore.org/bin/bitcoin-core-30.0/bitcoin-30.0-x86_64-linux-gnu.tar.gz | ||
| tar xzf bitcoin-30.0-x86_64-linux-gnu.tar.gz | ||
| sudo install -m 0755 -o root -g root -t /usr/local/bin bitcoin-30.0/bin/* | ||
| - name: Start Bitcoin Core (regtest) | ||
| run: | | ||
| mkdir -p ~/.bitcoin | ||
| bitcoind -regtest -daemon -rpcuser=test -rpcpassword=test -rpcport=18443 | ||
| sleep 5 | ||
| - name: Run integration tests | ||
| run: cargo test ${{ matrix.features }} --test integration -- --ignored --test-threads=1 | ||
| env: | ||
| BITCOIN_RPC_URL: http://localhost:18443 | ||
| BITCOIN_RPC_USER: bitcoin | ||
| BITCOIN_RPC_PASS: bitcoin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is needed, as ideally we should use the corepc-node (prev. bitcoind) for the integration tests, and it handles the download and wrapping (such as in bdk_testenv).
Can be done in a follow-up, let's get an initial CI running first :)
| name = "bdk-rpc-client" | ||
| name = "bdk_rpc_client" | ||
| version = "0.1.0" | ||
| edition = "2024" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| edition = "2024" | |
| edition = "2024" | |
| rust-version = "1.85.0" | |
| homepage = "https://bitcoindevkit.org" | |
| repository = "https://github.com/bitcoindevkit/bdk_rpc_client" | |
| documentation = "https://docs.rs/bdk_rpc_client" | |
| description = "A minimal production-ready bitcoind RPC client for Bitcoin Dev Kit." | |
| license = "MIT OR Apache-2.0" | |
| readme = "README.md" |
It's just a suggestion, can be done in a follow-up, and the description could be different too (if you have any other idea).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing authors field.
|
I've tested the CI in my fork (see https://github.com/oleonardolima/bdk-rpc-client/actions/runs/19510871935/job/55850429271) and it worked just fine. |
Yesterday's update removed the entire setup for Bitcoind. Please verify. |
|
We should be using pinned hashes, add See |
Oh, yes! All good now 🚀 |
- add audit, zizmor workflows and dependabot
I have included zizmor, audit and dependabot now. |
Description
Fixes #2
This PR adds a PR template, issue template, workflows for testing, fmt, and clippy.
Checklists
All Submissions:
cargo fmtandcargo clippybefore committing