xlsxparser 0.11.0

A lightweight, high-performance .xlsx (OOXML) parser library
Documentation
name: Rust CI

permissions:
  contents: read

on:
  push:
    branches: [master]
    paths:
      - "src/**"
      - "Cargo.toml"
      - "Cargo.lock"
      - "deny.toml"
      - ".github/workflows/rust-ci.yml"
  pull_request:
    paths:
      - "src/**"
      - "Cargo.toml"
      - "Cargo.lock"
      - "deny.toml"
      - ".github/workflows/rust-ci.yml"

env:
  CARGO_TERM_COLOR: always

jobs:
  fmt:
    name: Format check
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - run: cargo fmt --all --check

  clippy:
    name: Clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: Swatinem/rust-cache@v2
      - run: cargo clippy --all-targets --all-features -- -D warnings

  test:
    name: Build & test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo build --all-targets --all-features --verbose
      - run: cargo test --all-features --verbose

  coverage:
    name: Coverage (codecov)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: llvm-tools-preview
      - uses: taiki-e/install-action@cargo-llvm-cov
      - uses: Swatinem/rust-cache@v2
      - run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
      # fail_ci_if_error is false since CODECOV_TOKEN isn't provisioned yet
      # (README.md's Codecov badge reads "unknown" until it's added as a
      # repo secret) — once it is, this still won't fail the whole CI run
      # on a transient Codecov-side upload hiccup.
      - uses: codecov/codecov-action@v5
        with:
          files: lcov.info
          token: ${{ secrets.CODECOV_TOKEN }}
          fail_ci_if_error: false

  audit:
    name: Security audit (cargo-audit)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo generate-lockfile
      - run: cargo install cargo-audit --locked
      - run: cargo audit

  deny:
    name: Dependency policy (cargo-deny)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: EmbarkStudios/cargo-deny-action@v2
        with:
          command: check

  # dependency-review (actions/dependency-review-action) was tried in PR #17
  # but failed with "Dependency review is not supported on this repository.
  # Please ensure that Dependency graph is enabled" — a repo Settings >
  # Security setting outside this workflow's control, and with zero
  # dependencies today it adds no value yet. Re-add once dependencies exist
  # and the setting is confirmed enabled.