zedbar 0.4.2

Pure Rust barcode and QR code scanning library supporting multiple formats
Documentation
name: CI

on:
  push:
  pull_request:

jobs:
  shellcheck:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v6

      - name: Run shellcheck
        run: shellcheck demo/build.sh npm/build.sh

  rust:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v6

      - name: Install C dependencies
        run: |
          sudo apt-get update
          sudo apt-get install -y libzbar-dev libzbar0 zbar-tools

      - name: Verify zbarimg installation
        run: |
          which zbarimg
          zbarimg --version

      - name: Set up Rust
        uses: dtolnay/rust-toolchain@stable
        with:
          toolchain: stable
          components: clippy

      - name: Check formatting
        run: cargo fmt --check

      - name: Run clippy
        run: cargo clippy --all-targets --all-features -- -D warnings

      - name: Run tests
        run: cargo test

  # The crate advertises building with only the symbologies you need, so every
  # feature subset has to keep compiling. Scoped to `--lib`, which is what a
  # dependent consumes: the test targets assume the default features.
  #
  # Compile errors only, no `-D warnings`. A subset that leaves a decoder out
  # legitimately leaves its shared helpers unused, and gating those per
  # symbology would cost more readability than the warnings are worth.
  feature-matrix:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v6

      - name: Set up Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Install cargo-hack
        uses: taiki-e/install-action@cargo-hack

      # The bench features are excluded: bench_zbar_c needs the system zbar
      # library and bench_rxing pulls a large dependency, and neither is
      # something a dependent enables.
      - name: Check each feature subset
        run: cargo hack --each-feature --exclude-features bench_zbar_c,bench_rxing check --lib

  wasm:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v6

      - name: Set up Rust
        uses: dtolnay/rust-toolchain@stable

      - name: Install wasm-pack
        run: cargo install wasm-pack

      - name: Set up Node.js
        uses: actions/setup-node@v6
        with:
          node-version: '24'

      - name: Build npm package
        run: ./npm/build.sh

      - name: Install test dependencies
        run: npm ci
        working-directory: npm

      - name: Run WASM tests
        run: npm test
        working-directory: npm

      - name: Build demo site
        run: ./demo/build.sh