Skip to content

docs(site): VitePress site with static SVG diagrams (no Mermaid runtime) #189

docs(site): VitePress site with static SVG diagrams (no Mermaid runtime)

docs(site): VitePress site with static SVG diagrams (no Mermaid runtime) #189

Workflow file for this run

name: CI
on:
pull_request:
branches: ["main"]
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
editorconfig:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- name: EditorConfig check
uses: editorconfig-checker/action-editorconfig-checker@4b6cd6190d435e7e084fb35e36a096e98506f7b9 # v2.1.0
with:
version: "2.7.0"
fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
with:
toolchain: 1.81.0
components: rustfmt
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: rustfmt --check
run: cargo fmt --all -- --check
- name: Install dprint if missing
run: |
if ! command -v dprint >/dev/null 2>&1; then
cargo install dprint --locked
fi
- name: dprint check (JSON/YAML)
run: dprint check
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
with:
toolchain: 1.81.0
components: clippy
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: clippy (workspace default features)
run: cargo clippy --workspace -- -D warnings
- name: clippy (gatos-ledger core-only)
run: cargo clippy -p gatos-ledger --no-default-features --features core-only -- -D warnings
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
with:
toolchain: 1.81.0
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: cargo test (workspace)
run: cargo test --workspace --locked
- name: cargo test (gatos-ledger core-only)
run: cargo test -p gatos-ledger --no-default-features --features core-only --locked
- name: FFI test coverage
run: cargo test -p gatos-ffi-bindings --locked
- name: Install wasm32 target
run: rustup target add wasm32-unknown-unknown
- name: WASM target build verification
run: cargo build -p gatos-wasm-bindings --target wasm32-unknown-unknown --locked
- name: cargo test (doc tests)
run: cargo test --workspace --doc --locked
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
with:
toolchain: 1.81.0
- name: Dependency vulnerability audit
uses: actions-rs/audit-check@35b7b53b1e25b55642157ac01b4adceb5b9ebef3 # v1.2.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
msrv:
runs-on: ubuntu-latest
name: MSRV check (1.81.0)
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
with:
toolchain: 1.81.0
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: cargo test (MSRV)
run: cargo test --workspace --locked
markdownlint:
runs-on: ubuntu-latest
name: Markdownlint (xtask)
continue-on-error: true
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
with:
toolchain: 1.81.0
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: markdownlint via xtask (no Node)
env:
XTASK_MD_DEBUG: "1"
run: cargo run -p xtask -- md
schemas:
runs-on: ubuntu-latest
name: Schema validation (v1)
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
with:
toolchain: 1.81.0
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: "20.14.0"
cache: npm
- name: Validate schemas and examples (v1) via xtask
run: cargo run -p xtask -- schemas
# (removed duplicate markdownlint job id)
diagrams:
runs-on: ubuntu-latest
name: Mermaid Diagrams Generate + Verify
env:
CHROMIUM_REVISION: "1108766"
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
with:
toolchain: 1.81.0
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: Cache Puppeteer Chromium
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.cache/puppeteer
key: ${{ runner.os }}-puppeteer-chromium-${{ env.CHROMIUM_REVISION }}
- name: Setup Node.js
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: "20.14.0"
cache: npm
- name: Install Chromium for Puppeteer (exact revision)
shell: bash
run: |
set -euo pipefail
mkdir -p "$HOME/.cache/puppeteer"
OUT=$(npx -y @puppeteer/[email protected] install chromium@${{ env.CHROMIUM_REVISION }} --path "$HOME/.cache/puppeteer" | tail -n1)
echo "browsers install output: $OUT"
BIN_PATH=$(printf "%s" "$OUT" | sed -E 's/^[^ ]+ +//')
echo "Using Chromium at: $BIN_PATH"
echo "PUPPETEER_EXECUTABLE_PATH=$BIN_PATH" >> "$GITHUB_ENV"
echo "PUPPETEER_CACHE_DIR=$HOME/.cache/puppeteer" >> "$GITHUB_ENV"
- name: Generate Mermaid diagrams (full repo) via script
run: MERMAID_MAX_PARALLEL=6 bash ./scripts/diagrams.sh --all
- name: Fail if generation produced diffs
run: git diff --exit-code -- docs/diagrams/generated || (echo "Run 'bash ./scripts/diagrams.sh --all' (or 'node scripts/mermaid/generate.mjs --all') and commit updated diagrams" && exit 1)
- name: Verify committed diagrams metadata and tool pins
run: bash ./scripts/diagrams.sh --verify --all
linkcheck:
runs-on: ubuntu-latest
name: Link Check (xtask links)
env:
LYCHEE_VERSION: "0.21.0"
steps:
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1
with:
toolchain: 1.81.0
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2.8.1
- name: Cache lychee binary
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
with:
path: ~/.cargo/bin/lychee
key: ${{ runner.os }}-lychee-bin-${{ env.LYCHEE_VERSION }}
- name: Install lychee CLI
shell: bash
run: |
set -euo pipefail
if ! command -v lychee >/dev/null 2>&1; then
cargo install lychee --locked --version "$LYCHEE_VERSION"
fi
lychee --version
- name: Link check via xtask (uses lychee or Docker fallback)
env:
# Preserve authenticated GitHub rate limits for lychee CLI
LYCHEE_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cargo run -p xtask -- links