discrete_pid 0.2.0

A PID controller for robotics and discrete control systems
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:

jobs:
  test:
    name: Test (std + no_std)
    runs-on: ubuntu-latest

    strategy:
      matrix:
        include:
          - name: Default (std)
            features: ""
          - name: No-std
            features: "--no-default-features --lib --bins --tests --examples"

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true

      - name: Run tests - ${{ matrix.name }}
        run: cargo test ${{ matrix.features }}

  fmt:
    name: Format check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: rustfmt
        run: cargo fmt --check

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          components: clippy
      - name: Lint
        run: cargo clippy --all-targets --all-features -- -D warnings

  docs:
    name: Doc check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Build docs
        run: cargo doc --no-deps

  coverage:
    name: Code Coverage
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v4

      - name: Install Rust
        uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
          override: true

      - name: Install cargo-llvm-cov
        run: cargo install cargo-llvm-cov

      - name: Generate coverage report
        run:
          cargo llvm-cov --workspace --all-features --lcov --output-path
          lcov.info --ignore-filename-regex='(tests|examples|sim)'

      - name: Upload coverage reports to Codecov
        uses: codecov/codecov-action@v5
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          files: lcov.info
          fail_ci_if_error: true