mdcat-ng 0.2.0

cat for markdown: show markdown documents in terminals
Documentation
name: "Test & Lint"

on:
  push:
    # Don't run CI for tags; there's always a branch for the tag as well so
    # there's no point in testing it separately
    tags-ignore: "*"
    # Only test direct pushes to main; for other branches we can always create a
    # (draft) PR if we need CI. See https://github.com/orgs/community/discussions/26276#discussioncomment-3251154
    # for the general idea.
    branches: main
    paths-ignore:
      - tapes/**
      - README.md
      - CHANGELOG.md
      - LICENSE
  pull_request:

jobs:
  # Lint things which are independent from the build target
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      # Scripts
      - uses: docker://mvdan/shfmt
        with:
          args: -i 4 -l -d scripts/package
      - uses: docker://koalaman/shellcheck:stable
        with:
          args: -S style -o all scripts/package

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

      # Test formatting
      - run: cargo fmt --all -- --check

      # Dependency policies
      - uses: EmbarkStudios/cargo-deny-action@v2
      - uses: EmbarkStudios/cargo-deny-action@v2
        with:
          arguments: "--no-default-features"

      # Manpage
      - uses: docker://asciidoctor/docker-asciidoctor
        with:
          args: asciidoctor -b manpage -a reproducible --warnings mdcat.1.adoc
      - run: man -l --warnings=w --pager=cat mdcat.1
        env:
          MANWIDTH: 80

  # Test mdcat itself
  test:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest]
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy

      # Windows builds are slower; skip the no-default-features matrix there.

      # Test the library with every combination of non-default feature flags disabled.
      - run: cargo build --all-targets --locked --no-default-features
        if: ${{ !contains(matrix.os, 'windows') }}
      - run: cargo clippy --all-targets --locked --no-default-features
        if: ${{ !contains(matrix.os, 'windows') }}
      - run: cargo test --locked --no-default-features
        if: ${{ !contains(matrix.os, 'windows') }}

      # Build and test in the default configuration.
      - run: cargo build --all-targets --locked
      - run: cargo clippy --all-targets --locked
      - run: cargo test --locked
      - run: cargo doc --locked
        if: ${{ !contains(matrix.os, 'windows') }}

      # Smoke-test the CLI on the full example.
      - run: cargo run --bin mdcat -- sample/common-mark.md