mathlex 0.3.4

Mathematical expression parser for LaTeX and plain text notation, producing a language-agnostic AST
Documentation
name: CI

on:
  push:
    branches:
      - main
      - dev
  pull_request:
    branches:
      - main

env:
  CARGO_TERM_COLOR: always
  RUST_BACKTRACE: 1

jobs:
  test:
    name: Test Suite
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v5

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

      - name: Cache Cargo dependencies
        uses: Swatinem/rust-cache@v2

      - name: Build project
        run: cargo build --verbose

      - name: Run tests
        run: cargo test --verbose

      - name: Run tests with all features
        run: cargo test --all-features --verbose

  msrv:
    name: MSRV Check
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v5

      - name: Install MSRV toolchain
        uses: dtolnay/rust-toolchain@master
        with:
          toolchain: "1.85"

      - name: Cache Cargo dependencies
        uses: Swatinem/rust-cache@v2

      - name: Build with MSRV
        run: cargo build --verbose

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v5

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

      - name: Cache Cargo dependencies
        uses: Swatinem/rust-cache@v2

      - name: Run clippy
        # Use -W clippy::all with specific allows for:
        # - unnecessary_cast: swift-bridge macro generates these
        # - result_large_err: boxing would be breaking API change
        # - approx_constant: tests parse "3.14" not π
        run: cargo clippy --all-targets --all-features -- -D clippy::all -A clippy::unnecessary-cast -A clippy::result-large-err -A clippy::approx-constant

  fmt:
    name: Formatting
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v5

      - name: Install Rust toolchain with rustfmt
        uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt

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

  docs:
    name: Documentation
    runs-on: ubuntu-latest
    env:
      RUSTDOCFLAGS: -D warnings
    steps:
      - name: Checkout repository
        uses: actions/checkout@v5

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

      - name: Cache Cargo dependencies
        uses: Swatinem/rust-cache@v2

      - name: Build documentation
        run: cargo doc --no-deps --all-features