1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# CI for markdoc
#
# Pure-Rust library crate, no FFI, no path dependencies. Runs fmt,
# clippy and tests on Linux — no need for a multi-OS matrix since
# nothing platform-specific is exercised.
name: CI
on:
push:
branches:
pull_request:
branches:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: short
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cargo cache
uses: Swatinem/rust-cache@v2
with:
save-if: ${{ github.ref == 'refs/heads/main' }}
- name: cargo fmt --check
run: cargo fmt --all --check
- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
# Before the tests, so an edit to the corpus that also edits the hash
# the conformance test checks it against fails here, by name.
- name: The vendored conformance corpus is upstream's, byte for byte
run: tests/marktest/verify-vendored.sh
# Includes tests/conformance.rs: upstream Markdoc's own corpus, held as
# a ratchet against tests/conformance-baseline.txt.
- name: cargo test
run: cargo test --all-targets
- name: cargo doc
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps