Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 9 additions & 26 deletions .github/actions/setup-rbmt/action.yml
Original file line number Diff line number Diff line change
@@ -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
67 changes: 37 additions & 30 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -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 .
121 changes: 68 additions & 53 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 4 additions & 6 deletions .github/workflows/commits.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
name: Commits

on:
push:
branches: [ master ]
pull_request:

permissions: {}
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
31 changes: 18 additions & 13 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Rust CI

on: [push, pull_request]
on:
push:
pull_request:

permissions: {}
env:
Expand All @@ -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 }}
27 changes: 0 additions & 27 deletions .github/workflows/zizmor.yml

This file was deleted.

14 changes: 3 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -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
Loading
Loading