protocrap 0.3.2

A small, efficient, and flexible protobuf implementation
Documentation
name: CI

on:
  push:
    branches: [master]
  pull_request:
    branches: [master]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          targets: thumbv7m-none-eabi

      - name: Build no-std test
        run: cargo build -p no-std-test --target thumbv7m-none-eabi

      - name: Cache bazel
        uses: actions/cache@v4
        with:
          path: ~/.cache/bazel
          key: bazel-${{ runner.os }}-${{ hashFiles('MODULE.bazel', 'MODULE.bazel.lock', '.bazelrc') }}
          restore-keys: bazel-${{ runner.os }}-

      - name: Run all tests
        run: ./bazelisk.sh test //...

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

      - name: Install Rust nightly
        uses: dtolnay/rust-toolchain@nightly

      - name: Cache cargo
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/bin/cargo-fuzz
            ~/.cargo/registry
            ~/.cargo/git
            fuzz/target
          key: fuzz-${{ runner.os }}-${{ hashFiles('fuzz/Cargo.toml', 'fuzz/Cargo.lock') }}
          restore-keys: fuzz-${{ runner.os }}-

      - name: Install cargo-fuzz
        run: command -v cargo-fuzz || cargo install cargo-fuzz

      - name: Build and run fuzz tests
        run: |
          cargo +nightly fuzz run decode_raw -- -max_total_time=3
          cargo +nightly fuzz run decode_chunked -- -max_total_time=3