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
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Opt in to the v3 MSRV-aware resolver.
[resolver]
incompatible-rust-versions = "fallback"
99 changes: 50 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,69 +1,70 @@
name: Build & Test
# A few guiding principles.
#
# * Always use actions-rust-lang/setup-rust-toolchain for its built-in caching.
# * Complexity lives in the justfile, this runner is as light as possible.

name: CI

# Run on direct commits to master, including merges, and any pull requests against master.
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
# Quick canary of code as well as potential issues with upcoming toolchains.
check:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
toolchain: [stable, beta, nightly]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ matrix.toolchain }}
components: clippy,rustfmt
- run: just check
# Build and test the code across platforms.
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v3
- name: Update Toolchain
run: |
rustup default ${{ matrix.toolchain }}
rustup component add --toolchain ${{ matrix.toolchain }} rustfmt
rustup component add --toolchain ${{ matrix.toolchain }} clippy
rustup update ${{ matrix.toolchain }}
- name: Lint all targets
run: cargo clippy --all-targets
- name: Format
run: cargo fmt -- --check
- name: Build with defeault features
run: cargo build --verbose
- name: Check release build on Rust ${{ matrix.toolchain }}
run: cargo check --release --verbose --color always
- name: Unit test
run: cargo test --verbose --lib
- name: Doc test
run: cargo test --verbose --doc
# Check that library code can be compiled with MSRV (1.63.0).
- uses: actions/checkout@v4
- uses: extractions/setup-just@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: just test unit
features:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: just test features
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Modify build tools just for MSRV testing. This avoids us having
# to bump our MSRV just for tooling. Tooling doesn't effect consumers so not a risk.
- name: Prepare environment for MSRV toolchain
run: |
# Remove resolver = "3" line for MSRV compatibility. We use V3 to
# generate an MSRV-compliant lockfile, but this isn't necessary to
# check if library code is MSRV compliant. Any resolver can go
# and grab the versions specified in the committed lockfile.
#
# The V3 resolver is standard in rust 1.85.
sed -i '/resolver = "3"/d' Cargo.toml
- name: Install MSRV toolchain
run: |
rustup toolchain install 1.63.0
rustup default 1.63.0
- name: Build with MSRV compiler
run: cargo build --verbose
signet:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: just test msrv
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Sync signet
run: cargo test --verbose signet_syncs
bitcoind:
- uses: actions/checkout@v4
- uses: extractions/setup-just@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: just test sync
integration:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Integration test
run: cargo test -- --test-threads 1 --skip signet_syncs --nocapture
- uses: actions/checkout@v4
- uses: extractions/setup-just@v3
- uses: actions-rust-lang/setup-rust-toolchain@v1
- run: just test integration
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
Cargo.lock
/target
/data
/light_client_data
Expand Down
Loading
Loading