From 2b24f8c0be51abf8128d3d1d5d763ce9b4e92f55 Mon Sep 17 00:00:00 2001 From: Luis Schwab Date: Tue, 9 Jun 2026 07:49:51 -0300 Subject: [PATCH 1/5] chore(ci): bump `cargo-rbmt` to v0.3.0 and update `setup-rbmt` action --- .github/actions/setup-rbmt/action.yml | 35 +++++++-------------------- rbmt-version | 2 +- 2 files changed, 10 insertions(+), 27 deletions(-) diff --git a/.github/actions/setup-rbmt/action.yml b/.github/actions/setup-rbmt/action.yml index 107f269b..fcafb160 100644 --- a/.github/actions/setup-rbmt/action.yml +++ b/.github/actions/setup-rbmt/action.yml @@ -1,31 +1,14 @@ name: Setup cargo-rbmt - -description: Install cargo-rbmt - -inputs: - rbmt-version: - description: 'Git ref (commit, tag, or branch) of cargo-rbmt to install. If not provided, reads from rbmt-version file in repo root, or falls back to master.' - required: false - repo-url: - description: 'Git repository URL to install cargo-rbmt from. Defaults to the primary upstream repository.' - required: false - default: 'https://git.rust-bitcoin.org/rust-bitcoin/rust-bitcoin-maintainer-tools' +description: Install cargo-rbmt from crates.io runs: - using: "composite" + using: "composite" - steps: - - name: Install cargo-rbmt - shell: bash - env: - RBMT_VERSION: ${{ inputs.rbmt-version }} - REPO_URL: ${{ inputs.repo-url }} - run: | - [ -z "$RBMT_VERSION" ] && [ -f rbmt-version ] && RBMT_VERSION=$(cat rbmt-version) - [ -z "$RBMT_VERSION" ] && RBMT_VERSION=master - [ -z "$REPO_URL" ] && REPO_URL='https://git.rust-bitcoin.org/rust-bitcoin/rust-bitcoin-maintainer-tools' - cargo install --git "$REPO_URL" --rev "$RBMT_VERSION" cargo-rbmt --locked + steps: + - name: Install cargo-rbmt + shell: bash + run: cargo install cargo-rbmt --version "$(cat rbmt-version)" --locked - - name: Install Rust toolchains - shell: bash - run: cargo rbmt toolchains + - name: Install Rust Toolchains + shell: bash + run: cargo rbmt toolchains diff --git a/rbmt-version b/rbmt-version index 28739405..0d91a54c 100644 --- a/rbmt-version +++ b/rbmt-version @@ -1 +1 @@ -26452de7b1f36086b12bfe873302b60be71ec5d3 +0.3.0 From 56f4582c8ecc938ab52ce4dd019907163b5262a1 Mon Sep 17 00:00:00 2001 From: Luis Schwab Date: Tue, 9 Jun 2026 07:51:06 -0300 Subject: [PATCH 2/5] chore(ci): fold `cargo-audit` and `zizmor` jobs into the same workflow --- .github/workflows/audit.yml | 67 ++++++++++++++++++++---------------- .github/workflows/zizmor.yml | 27 --------------- 2 files changed, 37 insertions(+), 57 deletions(-) delete mode 100644 .github/workflows/zizmor.yml diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 73b27f3b..8c32be89 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -1,38 +1,45 @@ name: Audit -# Performs a security audit of Rust dependencies using `cargo-audit` through the `actions-rust-lang/audit` action. -# Runs nightly on schedule and when Cargo.toml, Cargo.lock, or audit.toml files are modified. -# Helps identify known security vulnerabilities in the dependency tree. +on: + push: + pull_request: + schedule: + - cron: "0 0 * * *" # Nightly + workflow_dispatch: permissions: {} env: CARGO_TERM_COLOR: always -on: - push: - paths: - # Run if workflow changes - - '.github/workflows/audit.yml' - # Run on changed dependencies - - '**/Cargo.toml' - - '**/Cargo.lock' - # Run if the configuration file changes - - '**/audit.toml' - # Rerun periodically to pick up new advisories - schedule: - - cron: '0 0 * * *' # Nightly - # Run manually - workflow_dispatch: - jobs: - audit: - runs-on: ubuntu-latest - permissions: - contents: read - issues: write - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - uses: actions-rust-lang/audit@72c09e02f132669d52284a3323acdb503cfc1a24 # v1.2.7 - name: Audit Rust Dependencies + cargo-audit: + name: Cargo Audit + runs-on: ubuntu-latest + permissions: + contents: read + issues: write + + steps: + - name: Checkout Repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - uses: actions-rust-lang/audit@72c09e02f132669d52284a3323acdb503cfc1a24 # v1.2.7 + name: Audit Rust Dependencies + + zizmor: + name: Zizmor + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Install uv + uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 + + - name: Run Zizmor + run: uvx zizmor . diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml deleted file mode 100644 index 44a52d21..00000000 --- a/.github/workflows/zizmor.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Zizmor - -on: - push: - pull_request: - workflow_dispatch: - schedule: - - cron: "0 12 * * 1" # Monday, 12:00:00 UTC - -permissions: {} - -jobs: - zizmor: - name: Action Static Analysis - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - - name: Install uv - uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0 - - - name: Run zizmor - run: uvx zizmor . From ab6d3e0aee3156f734fa8e5d6ee573d2757a18a1 Mon Sep 17 00:00:00 2001 From: Luis Schwab Date: Tue, 9 Jun 2026 07:52:08 -0300 Subject: [PATCH 3/5] chore(ci): standardize workflow formatting --- .github/workflows/code_coverage.yml | 121 ++++++++++++++++------------ .github/workflows/commits.yml | 10 +-- .github/workflows/rust.yml | 31 ++++--- 3 files changed, 90 insertions(+), 72 deletions(-) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 81f89b78..f4e1c48b 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -1,61 +1,76 @@ -on: [push, pull_request] - name: Code Coverage +on: + push: + pull_request: + permissions: {} env: CARGO_TERM_COLOR: always RUST_BACKTRACE: 1 jobs: - Codecov: - name: Code Coverage - runs-on: ubuntu-latest - env: - RUSTFLAGS: "-Cinstrument-coverage" - RUSTDOCFLAGS: "-Cinstrument-coverage" - LLVM_PROFILE_FILE: "report-%p-%m.profraw" - - steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - name: Install lcov tools - run: sudo apt-get install lcov -y - - name: Install rustup - run: curl https://sh.rustup.rs -sSf | sh -s -- -y - - name: Set default toolchain - run: rustup default nightly - - name: Set profile - run: rustup set profile minimal - - name: Add llvm tools - run: rustup component add llvm-tools-preview - - name: Update toolchain - run: rustup update - - name: Cache cargo - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 - with: - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Install grcov - run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi - - name: Test - run: cargo test -- --test-threads=1 - - name: Run grcov - run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info - - name: Generate HTML coverage report - run: genhtml -o coverage-report.html ./coverage/lcov.info - - name: Coveralls upload - uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.7 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - - name: Upload artifact - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: coverage-report - path: coverage-report.html + code-coverage: + name: Code Coverage + runs-on: ubuntu-latest + env: + RUSTFLAGS: "-Cinstrument-coverage" + RUSTDOCFLAGS: "-Cinstrument-coverage" + LLVM_PROFILE_FILE: "report-%p-%m.profraw" + + steps: + - name: Checkout Repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Install lcov Tools + run: sudo apt-get install lcov -y + + - name: Install rustup + run: curl https://sh.rustup.rs -sSf | sh -s -- -y + + - name: Set Default Toolchain + run: rustup default nightly + + - name: Set Minimal Profile + run: rustup set profile minimal + + - name: Add llvm Tools + run: rustup component add llvm-tools-preview + + - name: Update Toolchain + run: rustup update + + - name: Setup cargo Cache + uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Install grcov + run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi + + - name: Run Tests + run: cargo test -- --test-threads=1 + + - name: Run grcov + run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info + + - name: Generate HTML Coverage Report + run: genhtml -o coverage-report.html ./coverage/lcov.info + + - name: Coveralls Upload + uses: coverallsapp/github-action@648a8eb78e6d50909eff900e4ec85cab4524a45b # v2.3.7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload Artifact + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: coverage-report + path: coverage-report.html diff --git a/.github/workflows/commits.yml b/.github/workflows/commits.yml index 29a46aff..30d360ae 100644 --- a/.github/workflows/commits.yml +++ b/.github/workflows/commits.yml @@ -1,8 +1,6 @@ name: Commits on: - push: - branches: [ master ] pull_request: permissions: {} @@ -10,16 +8,16 @@ env: CARGO_TERM_COLOR: always jobs: - commit-signatures: - name: Check Commit Signatures + signatures: + name: Signatures runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout Repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false fetch-depth: 0 - - name: Check commit signatures + - name: Check Commit Signatures run: bash contrib/check-signatures.sh diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a511fb38..f61c78ea 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,6 +1,8 @@ name: Rust CI -on: [push, pull_request] +on: + push: + pull_request: permissions: {} env: @@ -17,48 +19,51 @@ jobs: include: - name: Check Formatting task: fmt --check - - name: Lint + - name: Lint Code task: lint - - name: Documentation - task: docs + - name: Build Documentation + task: docsrs steps: - - name: Checkout repository + - name: Checkout Repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Setup build cache + - name: Setup Build Cache uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 - name: Setup cargo-rbmt uses: ./.github/actions/setup-rbmt - - name: Run ${{ matrix.task }} + - name: ${{ matrix.name }} run: cargo rbmt ${{ matrix.task }} test: - name: Test - ${{ matrix.toolchain }} toolchain, ${{ matrix.lockfile }} deps + name: Test - ${{ matrix.name }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: include: - - toolchain: stable + - name: Stable Toolchain + Recent Lockfile + toolchain: stable lockfile: recent - - toolchain: msrv + - name: MSRV Toolchain + Minimal Lockfile + toolchain: msrv lockfile: minimal + steps: - - name: Checkout repository + - name: Checkout Repository uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - - name: Setup build cache + - name: Setup Build Cache uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 - name: Setup cargo-rbmt uses: ./.github/actions/setup-rbmt - - name: Run tests + - name: ${{ matrix.name }} run: cargo rbmt test --toolchain ${{ matrix.toolchain }} --lock-file ${{ matrix.lockfile }} From 0f08cf212cb0dacc2b78b7bc254be650ce47ef10 Mon Sep 17 00:00:00 2001 From: Luis Schwab Date: Tue, 9 Jun 2026 07:56:23 -0300 Subject: [PATCH 4/5] chore(rustc): bump stable to 1.96.0 and nightly yo nightly-2026-05-08 --- .gitignore | 14 +++----------- Cargo.toml | 4 ++-- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 59772600..4b79a083 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,9 @@ -# Generated by Cargo -# will have compiled files and executables +Cargo.lock +Cargo.lock.backup + debug/ target/ -# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries -# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html -Cargo.lock - -# These are backup files generated by rustfmt **/*.rs.bk - -# MSVC Windows builds of rustc generate these, which store debugging information *.pdb - -# Vim files *.swp diff --git a/Cargo.toml b/Cargo.toml index 6c5367de..f53a7ee2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -57,8 +57,8 @@ blocking-https-rustls = ["blocking", "bitreq/https-rustls"] blocking-https-rustls-probe = ["blocking", "bitreq/https-rustls-probe"] [package.metadata.rbmt.toolchains] -stable = "1.95.0" -nightly = "nightly-2026-03-18" +stable = "1.96.0" +nightly = "nightly-2026-05-08" [package.metadata.docs.rs] all-features = true From 050360924f7d1e07499ee8fd3fea83323410be1c Mon Sep 17 00:00:00 2001 From: Luis Schwab Date: Tue, 9 Jun 2026 08:01:08 -0300 Subject: [PATCH 5/5] chore(ci): update justfile - Use `cargo rbmt docsrs` to build documentation - Remove redundant `test-matrix` recipe --- README.md | 23 +++++++++++------------ justfile | 12 +++--------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 55cd73d3..195c11d7 100644 --- a/README.md +++ b/README.md @@ -30,18 +30,17 @@ A `justfile` is provided for convenience. Run `just` to see available commands: > Bitcoin Esplora API client library Available recipes: - audit # Run `cargo audit` [alias: a] - build # Build `rust-esplora-client` [alias: b] - check # Check code formatting, compilation, and linting [alias: c] - check-sigs # Checks whether all commits in this branch are signed [alias: cs] - doc # Generate documentation [alias: d] - doc-open # Generate and open documentation [alias: do] - fmt # Format code [alias: f] - lock # Regenerate Cargo-recent.lock and Cargo-minimal.lock [alias: l] - pre-push # Run pre-push checks [alias: p] - test # Run tests [alias: t] - test-matrix # Run tests with the toolchain + lockfile matrix - zizmor # Run Zizmor Static Analysis [alias: z] + audit # Run `cargo audit` [alias: a] + build # Build `rust-esplora-client` [alias: b] + check # Check code formatting, compilation, and linting [alias: c] + check-sigs # Checks whether all commits in this branch are signed [alias: cs] + doc # Generate documentation [alias: d] + doc-open # Generate and open documentation [alias: do] + fmt # Format code [alias: f] + lock # Regenerate Cargo-recent.lock and Cargo-minimal.lock [alias: l] + pre-push # Run pre-push checks [alias: p] + test # Run tests [alias: t] + zizmor # Run Zizmor Static Analysis [alias: z] ``` ## Minimum Supported Rust Version diff --git a/justfile b/justfile index d008c98a..f359085e 100644 --- a/justfile +++ b/justfile @@ -27,7 +27,7 @@ build: check: RBMT_LOG_LEVEL=progress cargo rbmt fmt --check RBMT_LOG_LEVEL=progress cargo rbmt lint - RBMT_LOG_LEVEL=progress cargo rbmt docs + RBMT_LOG_LEVEL=progress cargo rbmt docsrs [doc: "Checks whether all commits in this branch are signed"] check-sigs: @@ -35,13 +35,11 @@ check-sigs: [doc: "Generate documentation"] doc: - RBMT_LOG_LEVEL=progress cargo rbmt docs - RBMT_LOG_LEVEL=progress cargo rbmt run doc --no-deps + RBMT_LOG_LEVEL=progress cargo rbmt docsrs [doc: "Generate and open documentation"] doc-open: - RBMT_LOG_LEVEL=progress cargo rbmt docs - RBMT_LOG_LEVEL=progress cargo rbmt run doc --no-deps --open + RBMT_LOG_LEVEL=progress cargo rbmt docsrs --open [doc: "Format code"] fmt: @@ -53,10 +51,6 @@ lock: [doc: "Run tests"] test: - RBMT_LOG_LEVEL=verbose cargo rbmt test - -[doc: "Run tests with the toolchain + lockfile matrix"] -test-matrix: RBMT_LOG_LEVEL=verbose cargo rbmt test --toolchain stable --lock-file recent RBMT_LOG_LEVEL=verbose cargo rbmt test --toolchain msrv --lock-file minimal