bdk/.github/workflows/cont_integration.yml

155 lines
4.3 KiB
YAML

on: [push, pull_request]
name: Continuous integration
jobs:
build-test:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- 1.45.0 # MSRV
features:
- default
- minimal
- all-keys
- minimal,esplora
- key-value-db
- electrum
- compact_filters
- cli-utils,esplora,key-value-db,electrum
- compiler
include:
- rust: stable
features: compact_filters
clippy: skip
- rust: 1.45.0
features: compact_filters
clippy: skip
steps:
- name: checkout
uses: actions/checkout@v2
- name: cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
override: true
components: clippy
- name: build
uses: actions-rs/cargo@v1
with:
command: build
args: --features ${{ matrix.features }} --no-default-features
- name: clippy
if: ${{ matrix.rust == 'stable' && matrix.clippy != 'skip' }}
uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- name: test
if: ${{ matrix.test != 'skip' }}
uses: actions-rs/cargo@v1
with:
command: test
args: --features ${{ matrix.features }} --no-default-features
test-electrum:
name: Test Electrum
runs-on: ubuntu-16.04
container: bitcoindevkit/electrs
env:
MAGICAL_RPC_AUTH: USER_PASS
MAGICAL_RPC_USER: admin
MAGICAL_RPC_PASS: passw
MAGICAL_RPC_URL: 127.0.0.1:18443
MAGICAL_ELECTRUM_URL: tcp://127.0.0.1:60401
steps:
- name: checkout
uses: actions/checkout@v2
- name: cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
- name: toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: start core
run: ./ci/start-core.sh
- name: test
uses: actions-rs/cargo@v1
with:
command: test
args: --features test-electrum --no-default-features
check-wasm:
name: Check WASM
runs-on: ubuntu-16.04
env:
CC: clang-10
CFLAGS: -I/usr/include
steps:
- name: checkout
uses: actions/checkout@v2
- name: cache
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml','**/Cargo.lock') }}
# Install a recent version of clang that supports wasm32
- run: wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - || exit 1
- run: sudo apt-add-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-10 main" || exit 1
- run: sudo apt-get update || exit 1
- run: sudo apt-get install -y clang-10 libc6-dev-i386 || exit 1
- name: toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: wasm32-unknown-unknown
override: true
- name: check
uses: actions-rs/cargo@v1
with:
command: check
args: --target wasm32-unknown-unknown --features cli-utils,esplora --no-default-features
fmt:
name: Rust fmt
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v2
- name: toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt
- name: fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check