name: ci
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_call:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
defaults:
run:
shell: bash
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Install Rust
uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f with:
toolchain: stable
- name: Cache cargo
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ubuntu-test-${{ hashFiles('Cargo.lock') }}
restore-keys: |
ubuntu-test-
- name: Run the tests
run: cargo test --locked
- name: Build the documentation
run: cargo doc --locked --no-deps
env:
RUSTDOCFLAGS: -Dwarnings
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Install Rust
uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f with:
toolchain: stable
components: rustfmt
- name: Check formatting
run: cargo fmt --all -- --check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Install Rust
uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f with:
toolchain: stable
components: clippy
- name: Cache cargo
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ubuntu-clippy-${{ hashFiles('Cargo.lock') }}
restore-keys: |
ubuntu-clippy-
- name: Run Clippy
run: cargo clippy --locked --all-targets -- -D warnings
vectors:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Install Rust
uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f with:
toolchain: stable
- name: Cache cargo
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ubuntu-vectors-${{ hashFiles('Cargo.lock') }}
restore-keys: |
ubuntu-vectors-
- name: The six chain-event envelope vectors
run: |
cargo test --locked --test chain_events -- --exact \
pinned_tip_round_trip \
pinned_fork_round_trip \
pinned_reorg_round_trip \
pinned_invalidated_round_trip \
pinned_frozen_round_trip \
pinned_tip_age_round_trip | tee chain_events.out
grep -q '^test result: ok. 6 passed; 0 failed; 0 ignored' chain_events.out
- name: The ARC status vector
run: |
cargo test --locked --test verdicts -- --exact \
arc_p0_2_twenty_bodies_are_only_hints | tee verdicts.out
grep -q '^test result: ok. 1 passed; 0 failed; 0 ignored' verdicts.out
wasm32:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Install Rust
uses: dtolnay/rust-toolchain@e2a55d2ffb04f378e9626c28d38b36d230d1e12f with:
toolchain: stable
targets: wasm32-unknown-unknown
- name: Cache cargo
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ubuntu-wasm32-${{ hashFiles('Cargo.lock') }}
restore-keys: |
ubuntu-wasm32-
- name: Build for wasm32-unknown-unknown
run: cargo build --locked --target wasm32-unknown-unknown --features wasm