This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
Ignore all descriptions for rendered images #915
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
- screenshots/** | |
- README.md | |
- CHANGELOG.md | |
- LICENSE | |
pull_request: | |
jobs: | |
scripts_and_manage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Test scripts | |
- run: | | |
curl -fsSL -o ./shfmt https://github.com/mvdan/sh/releases/download/v3.6.0/shfmt_v3.6.0_linux_amd64 | |
chmod 700 ./shfmt | |
- run: ./shfmt -i 4 -l -d scripts/* | |
- run: shellcheck -S style -o all scripts/* | |
# Test manpage | |
- run: sudo gem install asciidoctor | |
- run: asciidoctor -b manpage -a reproducible --warnings mdcat.1.adoc | |
- run: man -l --warnings=w --pager=cat mdcat.1 | |
env: | |
MANWIDTH: 80 | |
# Check dependency policies | |
deny: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
# Check our library without any features (we do need to pick a regex | |
# engine tho) | |
- uses: EmbarkStudios/cargo-deny-action@v1 | |
with: | |
arguments: "--no-default-features --features regex-fancy" | |
manifest-path: "./pulldown-cmark-mdcat/Cargo.toml" | |
# Test mdcat in its default configuration (this implicitly checks the | |
# default configuration of our libraries) | |
- uses: EmbarkStudios/cargo-deny-action@v1 | |
with: | |
# Need to pass an empty arg list explicitly, because otherwise the | |
# action passes --all-features | |
arguments: "" | |
# Test the static build for our release artifacts | |
- uses: EmbarkStudios/cargo-deny-action@v1 | |
with: | |
arguments: "--no-default-features --features static" | |
# Test mdcat itself | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
target: | |
# Default linux build | |
- x86_64-unknown-linux-gnu | |
# Statically linked linux builds | |
- x86_64-unknown-linux-musl | |
# macOS | |
- x86_64-apple-darwin | |
# Windows | |
- x86_64-pc-windows-msvc | |
include: | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
cargo_opts: "--no-default-features --features static" | |
- target: x86_64-apple-darwin | |
os: macOS-latest | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Install musl tools for musl target | |
- run: sudo apt-get install musl-tools | |
if: ${{ contains(matrix.target, 'musl') }} | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
components: clippy,rustfmt | |
# Test formatting | |
- run: cargo fmt --all -- --check | |
# Since Windows builds are comparatively slow, we skip quite a few builds on Windows to speed up pipelines | |
# Test library with no features; however we need to pick a regex engine | |
- run: cargo build -p pulldown-cmark-mdcat --all-targets --locked --no-default-features --features regex-fancy | |
if: ${{ !contains(matrix.target, 'windows') }} | |
- run: cargo clippy -p pulldown-cmark-mdcat --all-targets --locked --no-default-features --features regex-fancy | |
if: ${{ !contains(matrix.target, 'windows') }} | |
- run: cargo test -p pulldown-cmark-mdcat --locked --no-default-features --features regex-fancy | |
if: ${{ !contains(matrix.target, 'windows') }} | |
- run: cargo doc -p pulldown-cmark-mdcat --locked --no-default-features --features regex-fancy | |
if: ${{ !contains(matrix.target, 'windows') }} | |
# Build and test entire workspace in default configuration | |
- run: cargo build --workspace --all-targets --locked --target ${{ matrix.target }} ${{ matrix.cargo_opts }} | |
- run: cargo clippy --workspace --all-targets --locked --target ${{ matrix.target }} ${{ matrix.cargo_opts }} | |
- run: cargo test --workspace --locked --target ${{ matrix.target }} ${{ matrix.cargo_opts }} | |
- run: cargo doc --workspace --locked --target ${{ matrix.target }} ${{ matrix.cargo_opts }} | |
if: ${{ !contains(matrix.target, 'windows') }} | |
# Run on our complete example, just to assert that the CLI doesn't crash | |
- run: cargo run --target ${{ matrix.target }} ${{ matrix.cargo_opts }} -- sample/common-mark.md |