-
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8c70671
add pull request template and changelog
tvpeter ed39a3e
add integration tests workflow
tvpeter 6e9730c
feat(git-workflow): add issues template
tvpeter 748456e
feat(git-workflow): harmonize toolchain
tvpeter 6e940f7
improve lib meta data
tvpeter cbba98c
remove integration test workflow
tvpeter 10dccdb
feat(git-workflow): add audit, zizmor & dependabot
tvpeter 89aa6f0
docs: update README
tvpeter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,187 @@ | ||
| on: [push, pull_request] | ||
|
|
||
| name: CI | ||
|
|
||
| jobs: | ||
| # formatting | ||
| fmt: | ||
| name: Rust fmt | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: rustfmt | ||
|
|
||
| - name: Check fmt | ||
| run: cargo fmt --all -- --check | ||
|
|
||
| # Clippy lints | ||
| clippy: | ||
| name: Clippy (${{ matrix.rust }}, ${{ matrix.features }}) | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| rust: [stable, beta] | ||
| features: | ||
| - --features default | ||
| - --no-default-features | ||
| - --all-features | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust ${{ matrix.rust }} | ||
| uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: ${{ matrix.rust }} | ||
| components: clippy | ||
|
|
||
| - name: Generate cache key | ||
| 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') }} | ||
|
|
||
| - name: Cache cargo build | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: target | ||
| key: ${{ runner.os }}-${{ matrix.rust }}-cargo-build-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.lock') }} | ||
|
|
||
| - name: Run Clippy | ||
| run: cargo clippy ${{ matrix.features }} --all-targets -- -D warnings | ||
|
|
||
| # Build and test | ||
| test: | ||
| name: Test (${{ matrix.os }}, ${{ matrix.rust }}, ${{ matrix.features }}) | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-latest, windows-latest, macos-latest] | ||
| rust: [stable, beta, nightly] | ||
| features: | ||
| - --features default | ||
| - --no-default-features | ||
| - --all-features | ||
| exclude: | ||
| - os: windows-latest | ||
| rust: beta | ||
| - os: windows-latest | ||
| features: --no-default-features | ||
| - os: macos-latest | ||
| rust: beta | ||
| - os: macos-latest | ||
| features: --no-default-features | ||
| - os: windows-latest | ||
| rust: nightly | ||
| features: --no-default-features | ||
| - os: macos-latest | ||
| rust: nightly | ||
| features: --no-default-features | ||
| runs-on: ${{ matrix.os }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust ${{ matrix.rust }} | ||
| uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: ${{ matrix.rust }} | ||
|
|
||
| - 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') }} | ||
|
|
||
| - name: Cache cargo build | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: target | ||
| key: ${{ runner.os }}-${{ matrix.rust }}-cargo-build-${{ hashFiles('.cache_key') }}-${{ hashFiles('**/Cargo.lock') }} | ||
|
|
||
| - name: Build | ||
| run: cargo build ${{ matrix.features }} --verbose | ||
|
|
||
| - name: Run unit tests | ||
| run: cargo test ${{ matrix.features }} --lib --verbose | ||
|
|
||
| - name: Run doc tests | ||
| run: cargo test ${{ matrix.features }} --doc --verbose | ||
| continue-on-error: ${{ matrix.rust == 'nightly' }} | ||
|
|
||
|
|
||
| # Integration tests (requires Bitcoin node) | ||
| integration-test: | ||
| name: Integration Tests (${{ matrix.features }}) | ||
| runs-on: ubuntu-latest | ||
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
| strategy: | ||
| matrix: | ||
| features: | ||
| - --features default | ||
| - --all-features | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust | ||
| uses: dtolnay/rust-toolchain@stable | ||
|
|
||
| - 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 | ||
oleonardolima marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| - name: Stop Bitcoin Core | ||
| if: always() | ||
| run: bitcoin-cli -regtest -rpcuser=bitcoin -rpcpassword=bitcoin stop || true | ||
|
|
||
| # MSRV | ||
| msrv: | ||
| name: MSRV | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Rust 1.70.0 | ||
| uses: dtolnay/rust-toolchain@master | ||
| with: | ||
| toolchain: 1.70.0 | ||
|
|
||
| - name: Check MSRV | ||
| run: cargo check --all-features | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,12 @@ | ||
| [package] | ||
| name = "bdk-rpc-client" | ||
| name = "bdk_rpc_client" | ||
oleonardolima marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| version = "0.1.0" | ||
| edition = "2024" | ||
oleonardolima marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| [dependencies] | ||
| corepc-types = { version = "0.10.1", features = ["default"]} | ||
| jsonrpc = { version = "0.18.0", features = ["simple_http", "simple_tcp", "minreq_http", "simple_uds", "proxy"] } | ||
|
|
||
| [features] | ||
| default = [ "v30" ] | ||
| v30 = [ ] | ||
oleonardolima marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.