darkbio-wire 0.6.0

Encrypted protocol between Ark and host
Documentation
name: tests

on:
  push:
    branches: [ "main" ]
  pull_request:
    branches: [ "main" ]
  schedule:
    - cron: "0 3 * * *"

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: Test on ${{ matrix.os }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ ubuntu-latest, windows-latest, macOS-latest ]

    steps:
      - uses: actions/checkout@v7

      - name: Build
        run: cargo build --verbose

      - name: Install cargo-hack
        run: cargo install cargo-hack

      - name: Build individual features
        run: cargo hack build --each-feature

      - name: Test individual features
        run: cargo hack test --each-feature

      - name: Test with all features
        run: cargo test --all-features

  format:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - run: cargo fmt --all -- --check

  clippy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - run: cargo clippy --all-features -- -D warnings

  docs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - run: cargo doc --all-features --no-deps

  vectors:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - run: |
          make vectors
          if [ -n "$(git status --porcelain vectors)" ]; then
            git status --short vectors
            echo "vectors are stale, run make vectors and commit"
            exit 1
          fi

  fuzz:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7

      - name: Install nightly toolchain
        run: rustup install nightly

      - name: Install cargo-fuzz
        run: cargo install cargo-fuzz

      - name: Check the seeds match the scenario tests
        run: |
          make fuzz-seeds
          if [ -n "$(git status --porcelain fuzz/seeds)" ]; then
            git status --short fuzz/seeds
            echo "seeds are stale, run make fuzz-seeds and commit"
            exit 1
          fi

      - name: Run all fuzzers from their corpus and seeds
        run: make fuzz FUZZ_TIME=${{ github.event_name == 'schedule' && 600 || 60 }} FUZZ_SANITIZER=address