Skip to content

Commit

Permalink
Merge branch 'main' into feature/test-scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ZamDimon authored Sep 16, 2024
2 parents 1380055 + 28ebffd commit 100cd8e
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 33 deletions.
82 changes: 82 additions & 0 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Rust

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -Dwarnings
rust_min: 1.74.0 # because of bumpalo (requires 1.74.0)
# clap requires 1.74.0
rust_clippy: 1.77.0
rust_nightly: nightly-2024-05-05

defaults:
run:
shell: bash

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust_min }}
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --verbose

clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ env.rust_clippy }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust_clippy }}
components: clippy
- uses: Swatinem/rust-cache@v2
- name: "clippy --all"
run: cargo clippy --all --tests --all-features --no-deps

doc:
name: doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ env.rust_nightly }}
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.rust_min }}
- uses: Swatinem/rust-cache@v2
- name: "doc --lib --all-features"
run: |
cargo doc --lib --no-deps --all-features --document-private-items
env:
RUSTDOCFLAGS: -Dwarnings

test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust ${{ env.rust_stable }}
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-nextest
uses: taiki-e/install-action@v2
with:
tool: cargo-nextest
- uses: Swatinem/rust-cache@v2
- name: test full
run: |
set -euxo pipefail
cargo nextest run
cargo test --doc
33 changes: 33 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[workspace]
members = ["splitter"]
resolver = "2"

[profile.dev]
opt-level = 3

[profile.release]
lto = true

[patch.crates-io.base58check]
git = "https://github.com/rust-bitcoin/rust-bitcoin"
branch = "bitvm"

[patch.crates-io.bitcoin]
git = "https://github.com/rust-bitcoin/rust-bitcoin"
branch = "bitvm"

[patch.crates-io.bitcoin_hashes]
git = "https://github.com/rust-bitcoin/rust-bitcoin"
branch = "bitvm"

[patch.crates-io.bitcoin-internals]
git = "https://github.com/rust-bitcoin/rust-bitcoin"
branch = "bitvm"

[patch.crates-io.bitcoin-io]
git = "https://github.com/rust-bitcoin/rust-bitcoin"
branch = "bitvm"

[patch.crates-io.bitcoin-units]
git = "https://github.com/rust-bitcoin/rust-bitcoin"
branch = "bitvm"
34 changes: 1 addition & 33 deletions splitter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,7 @@ num-traits = "0.2.18"

# Random libraries
rand_chacha = "0.3.1"
rand = "0.8.0"

[dev-dependencies]
rand = "0.8.5"
num-bigint = { version = "0.4.4", features = ["rand"] }
ark-std = "0.4.0"
konst = "0.3.9"

[profile.dev]
opt-level = 3

[profile.release]
lto = true

[patch.crates-io.base58check]
git = "https://github.com/rust-bitcoin/rust-bitcoin"
branch = "bitvm"

[patch.crates-io.bitcoin]
git = "https://github.com/rust-bitcoin/rust-bitcoin"
branch = "bitvm"

[patch.crates-io.bitcoin_hashes]
git = "https://github.com/rust-bitcoin/rust-bitcoin"
branch = "bitvm"

[patch.crates-io.bitcoin-internals]
git = "https://github.com/rust-bitcoin/rust-bitcoin"
branch = "bitvm"

[patch.crates-io.bitcoin-io]
git = "https://github.com/rust-bitcoin/rust-bitcoin"
branch = "bitvm"

[patch.crates-io.bitcoin-units]
git = "https://github.com/rust-bitcoin/rust-bitcoin"
branch = "bitvm"

0 comments on commit 100cd8e

Please sign in to comment.