srz 0.3.0

Fast, modular CLI to summarize webpages, documents, books, and live news using local LLMs
name: CI & Security

on:
  push:
    branches:
      - master
    paths-ignore:
      - '**.md'
      - 'docs/**'
      - 'assets/**'
      - '.gitignore'
      - 'LICENSE*'
  pull_request:
    branches:
      - master
    paths-ignore:
      - '**.md'
      - 'docs/**'
      - 'assets/**'
      - '.gitignore'
      - 'LICENSE*'

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

permissions:
  contents: read
  actions: write

jobs:
  test:
    name: Test & Lint (${{ matrix.os }})
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
          - os: macos-latest
    runs-on: ${{ matrix.os }}
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

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

      - name: Set up sccache
        uses: mozilla/sccache-action@v0.0.8

      - name: Configure sccache
        shell: bash
        run: |
          echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
          echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV

      - name: Rust Cache
        uses: Swatinem/rust-cache@v2

      - name: Install Linux build dependencies
        if: matrix.os == 'ubuntu-latest'
        run: |
          sudo apt-get update
          sudo apt-get install -y pkg-config libssl-dev build-essential cmake

      - name: Run cargo test
        run: cargo test --all-targets

      - name: Run cargo clippy (warnings denied)
        run: cargo clippy --all-targets -- -D warnings

      - name: Show sccache stats
        if: always()
        run: sccache --show-stats

  security-audit:
    name: Dependency Security Audit
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Run RustSec Advisory Audit
        uses: rustsec/audit-check@v1.4.1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}