f add a bunch of test programs siwtch from Core to Elements #1259
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
name: Continuous integration | |
jobs: | |
fmt: | |
name: Rustfmt | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- stable | |
steps: | |
- name: Checkout Crate | |
uses: actions/checkout@v2 | |
- name: Checkout Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
override: true | |
components: rustfmt | |
- name: Running cargo fmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
bench_test: | |
name: Jets-Bench Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- stable | |
steps: | |
- name: Checkout Crate | |
uses: actions/checkout@v2 | |
- name: Checkout Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
override: true | |
- name: Running cargo test | |
run: | | |
cargo install cargo-criterion | |
cd jets-bench | |
cargo test | |
cargo criterion --no-run | |
test: | |
name: Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- stable | |
- 1.41.0 | |
- beta | |
- nightly | |
steps: | |
- name: Checkout Crate | |
uses: actions/checkout@v2 | |
- name: Checkout Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
override: true | |
- name: Running cargo test | |
env: | |
FEATURES: bitcoin elements test-utils | |
run: | | |
if cargo --version | grep "1\.41"; then | |
# 1.0.157 uses syn 2.0 which requires edition 2018 | |
cargo update -p serde --precise 1.0.156 | |
# 1.0.108 uses `matches!` macro so does not work with Rust 1.41.1, bad `syn` no biscuit. | |
cargo update -p syn --precise 1.0.107 | |
fi | |
for f in $FEATURES; do echo "Features: $f" && cargo test --no-default-features --features="$f"; done | |
echo "No default features" && cargo test --no-default-features | |
echo "All features" && cargo test --all-features | |
ignored: | |
name: Ignored Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- stable | |
steps: | |
- name: Checkout Crate | |
uses: actions/checkout@v2 | |
- name: Checkout Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
override: true | |
- name: Running cargo test | |
run: | | |
cargo test -- --ignored | |
clippy: | |
name: Clippy | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- stable | |
steps: | |
- name: Checkout Crate | |
uses: actions/checkout@v2 | |
- name: Checkout Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
override: true | |
components: clippy | |
- name: Running cargo clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: -- -D warnings | |
fuzz: | |
name: Fuzz Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
rust: | |
- 1.58.0 | |
steps: | |
- name: Checkout Crate | |
uses: actions/checkout@v2 | |
- name: Install hongfuzz dependancies | |
run: sudo apt update && sudo apt install build-essential binutils-dev libunwind-dev libblocksruntime-dev liblzma-dev | |
- name: Checkout Toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: ${{ matrix.rust }} | |
override: true | |
- name: Running cargo test | |
env: | |
FEATURES: honggfuzz_fuzz | |
run: | | |
cd fuzz/ | |
cargo test | |
RUSTFLAGS=--cfg=fuzzing cargo test | |
- name: Running fuzz tests | |
run: | | |
cd fuzz/ | |
./travis-fuzz.sh | |