name: "Test & Lint"
on:
push:
tags-ignore: "*"
branches: main
paths-ignore:
- tapes/**
- README.md
- CHANGELOG.md
- LICENSE
pull_request:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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
- run: cargo fmt --all -- --check
- uses: EmbarkStudios/cargo-deny-action@v2
- uses: EmbarkStudios/cargo-deny-action@v2
with:
arguments: "--no-default-features"
- 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:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- 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') }}
- 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') }}
- run: cargo run --bin mdcat -- sample/common-mark.md