mdr 0.3.1

A lightweight Markdown viewer with live reload and multiple rendering backends
name: CI

on:
  push:
    branches: [main, master]
  pull_request:
    branches: [main, master]

env:
  CARGO_TERM_COLOR: always

jobs:
  check:
    name: Check (${{ matrix.os }})
    runs-on: ${{ matrix.os }}
    timeout-minutes: 90
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest, windows-latest]

    steps:
      - uses: actions/checkout@v4

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

      - name: Cache cargo
        uses: actions/cache@v4
        with:
          path: |
            ~/.cargo/registry
            ~/.cargo/git
            target
          key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.toml') }}
          restore-keys: ${{ runner.os }}-cargo-

      - name: Install Linux dependencies
        if: runner.os == 'Linux'
        run: |
          sudo apt-get update
          sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libxdo-dev libgl1-mesa-dev

      - name: Build (all features)
        run: cargo build --release

      - name: Build (egui only)
        run: cargo build --release --no-default-features --features egui-backend

      - name: Build (webview only)
        run: cargo build --release --no-default-features --features webview-backend

      - name: Build (tui only)
        run: cargo build --release --no-default-features --features tui-backend

      - name: Run clippy
        run: cargo clippy -- -D warnings
        continue-on-error: true

      - name: Run tests
        run: cargo test