blvm-consensus 0.1.21

Bitcoin Commons BLVM: Direct mathematical implementation of Bitcoin consensus rules from the Orange Paper
Documentation
name: Consensus setup
description: >
  Strip [patch.crates-io] + refresh blvm-spec.
  Run this immediately after actions/checkout in every job that
  compiles blvm-consensus, so the #[spec_locked] proc-macro always
  sees a current spec on self-hosted runners where the workspace
  directory persists between jobs.
  Note: actions/checkout must come first (local actions require the
  repo to already be checked out before they can be resolved).

runs:
  using: composite
  steps:
    - name: Strip [patch.crates-io] for crates.io-only CI
      uses: BTCDecoded/rust-ci/strip-patch-crates-io@main

    - name: Setup blvm-spec (for #[spec_locked] proc-macro)
      uses: BTCDecoded/rust-ci/setup-blvm-spec@main

    - name: Force-refresh blvm-spec to HEAD on persistent runners
      shell: bash
      run: |
        # Self-hosted runners persist the workspace between jobs/runs.
        # setup-blvm-spec@main may clone once and not update the working tree on
        # subsequent runs, leaving the proc-macro with a stale spec (missing new
        # sections like ยง5.3.2).  Force a fetch+checkout so the working tree always
        # matches origin/main before any cargo compilation step.
        if [ -d "../blvm-spec/.git" ]; then
          git -C ../blvm-spec fetch --depth=1 origin main 2>&1 || true
          git -C ../blvm-spec checkout FETCH_HEAD 2>&1 || true
          echo "blvm-spec HEAD: $(git -C ../blvm-spec rev-parse --short HEAD)"
        fi