cobs_codec_rs 1.3.0

Consistent Overhead Byte Stuffing (COBS) and COBS/R codec: no_std, zero-dependency, for zero-free framing of serial and packet byte streams.
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

permissions:
  contents: read

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: "-D warnings"

jobs:
  check:
    name: fmt, clippy, test, docs
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt, clippy
      - name: Formatting
        run: cargo fmt --check
      - name: Clippy (all features)
        run: cargo clippy --all-targets --all-features -- -D warnings
      - name: Clippy (no_std)
        run: cargo clippy --no-default-features -- -D warnings
      - name: Test
        run: cargo test --all-features
      - name: Docs
        run: cargo doc --no-deps --all-features
        env:
          RUSTDOCFLAGS: "-D warnings"

  no-std:
    name: no_std build (bare metal)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: thumbv7em-none-eabihf
      - name: Build for a no_std target
        run: cargo build --no-default-features --target thumbv7em-none-eabihf

  msrv:
    name: minimum supported Rust (1.85)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@1.85.0
      - run: cargo build --all-features

  conformance:
    name: Conformance vectors
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: dtolnay/rust-toolchain@stable
      - name: Download shared conformance vectors
        run: |
          base=https://raw.githubusercontent.com/firechip/cobs-conformance/v1.1.0/vectors
          curl -sSfL -o vectors.jsonl "$base/vectors.jsonl"
          curl -sSfL -o sentinel.jsonl "$base/sentinel.jsonl"
          curl -sSfL -o errors.jsonl "$base/errors.jsonl"
      - name: Check conformance
        env:
          COBS_CONFORMANCE_VECTORS: ${{ github.workspace }}/vectors.jsonl
          COBS_CONFORMANCE_SENTINEL: ${{ github.workspace }}/sentinel.jsonl
          COBS_CONFORMANCE_ERRORS: ${{ github.workspace }}/errors.jsonl
        run: cargo test --test conformance --all-features -- --nocapture