name: "Test & Lint"
on:
push:
tags-ignore: "*"
branches: main
paths-ignore:
- screenshots/**
- README.md
- CHANGELOG.md
- LICENSE
pull_request:
jobs:
cargo-vet:
runs-on: ubuntu-latest
env:
CARGO_VET_VERSION: 0.10.0
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: actions/cache@v4
with:
path: ${{ runner.tool_cache }}/cargo-vet
key: cargo-vet-bin-${{ env.CARGO_VET_VERSION }}
- run: echo "${{ runner.tool_cache }}/cargo-vet/bin" >> $GITHUB_PATH
- run: cargo install --root ${{ runner.tool_cache }}/cargo-vet --version ${{ env.CARGO_VET_VERSION }} cargo-vet
- run: cargo vet --locked
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker://mvdan/shfmt
with:
args: -i 4 -l -d scripts/combine-screenshots scripts/package scripts/screenshot-windows
- uses: docker://koalaman/shellcheck:stable
with:
args: -S style -o all scripts/combine-screenshots scripts/package scripts/screenshot-windows
- 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"
manifest-path: "./pulldown-cmark-mdcat/Cargo.toml"
- 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 -p pulldown-cmark-mdcat --all-targets --locked --no-default-features
if: ${{ !contains(matrix.os, 'windows') }}
- run: cargo clippy -p pulldown-cmark-mdcat --all-targets --locked --no-default-features
if: ${{ !contains(matrix.os, 'windows') }}
- run: cargo test -p pulldown-cmark-mdcat --locked --no-default-features
if: ${{ !contains(matrix.os, 'windows') }}
- run: cargo doc -p pulldown-cmark-mdcat --locked --no-default-features
if: ${{ !contains(matrix.os, 'windows') }}
- run: cargo build --workspace --all-targets --locked
- run: cargo clippy --workspace --all-targets --locked
- run: cargo test --workspace --locked
- run: cargo doc --workspace --locked
if: ${{ !contains(matrix.os, 'windows') }}
- run: cargo run -- sample/common-mark.md