Skip to content
This repository was archived by the owner on Apr 27, 2026. It is now read-only.

fix: prevent false component matches in set:html content and remove P… #550

fix: prevent false component matches in set:html content and remove P…

fix: prevent false component matches in set:html content and remove P… #550

Workflow file for this run

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
workflow_dispatch:
permissions:
contents: read
jobs:
build-and-test:
name: Build, Lint, and Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: crates/napi/pnpm-lock.yaml
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Rust dependencies
uses: swatinem/rust-cache@v2
- name: Check formatting
run: cargo fmt --all -- --check
- name: Run clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Run rust tests
run: cargo test --workspace
- name: Install dependencies
working-directory: crates/napi
run: pnpm install --frozen-lockfile
- name: Build NAPI binding
working-directory: crates/napi
run: pnpm run build:napi
- name: Smoke test NAPI binding
working-directory: crates/napi
run: pnpm run smoke:napi -- fixtures/core/markdown/hello.md
- name: Run NAPI tests (AVA)
working-directory: crates/napi
run: pnpm test
packages:
name: Packages Quality Check
runs-on: ubuntu-latest
needs: build-and-test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: pnpm-lock.yaml
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: swatinem/rust-cache@v2
- name: Install NAPI deps and build
working-directory: crates/napi
run: pnpm install --frozen-lockfile && pnpm run build:napi
- name: Install workspace dependencies
run: pnpm install --frozen-lockfile
- name: Typecheck markflow
working-directory: packages/markflow
run: pnpm run typecheck
- name: Typecheck astro-markflow
working-directory: packages/astro-markflow
run: pnpm run typecheck
- name: Lint astro-loader
working-directory: packages/astro-loader
run: pnpm run lint
- name: Build astro-loader
working-directory: packages/astro-loader
run: pnpm run build
- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Test markflow package
working-directory: packages/markflow
run: bun test
- name: Test astro-markflow package
working-directory: packages/astro-markflow
run: bun test
e2e-withastro-docs:
name: E2E (withastro-docs 6000 pages)
runs-on: ubuntu-latest
needs: build-and-test
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: |
crates/napi/pnpm-lock.yaml
fixtures/integration/withastro-docs/repo/pnpm-lock.yaml
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: swatinem/rust-cache@v2
- name: Install NAPI deps
working-directory: crates/napi
run: pnpm install --frozen-lockfile
- name: Build NAPI binding
working-directory: crates/napi
run: pnpm run build:napi
- name: Clone withastro-docs repository
run: ./scripts/setup-withastro-docs.sh
- name: Install all workspace deps
run: pnpm install --no-frozen-lockfile
- name: Build withastro-docs (Performance Regression Check)
id: build
working-directory: fixtures/integration/withastro-docs/repo
run: |
start_time=$(date +%s)
pnpm build
end_time=$(date +%s)
build_time=$((end_time - start_time))
echo "build_time=${build_time}" >> $GITHUB_OUTPUT
echo "::notice::Build completed in ${build_time} seconds"
e2e-withastro-docs-semantic-diff:
name: E2E Semantic Diff (baseline vs markflow)
runs-on: ubuntu-latest
needs: build-and-test
timeout-minutes: 45
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: |
crates/napi/pnpm-lock.yaml
fixtures/integration/withastro-docs/repo/pnpm-lock.yaml
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: swatinem/rust-cache@v2
- name: Install NAPI deps
working-directory: crates/napi
run: pnpm install --frozen-lockfile
- name: Build NAPI binding
working-directory: crates/napi
run: pnpm run build:napi
- name: Clone withastro-docs repository
run: ./scripts/setup-withastro-docs.sh
- name: Install all workspace deps
run: pnpm install --no-frozen-lockfile
- name: Run Semantic Diff (baseline vs markflow)
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: pnpm compare:withastro-docs -- --mode=semantic
- name: Upload diff summary
if: always()
uses: actions/upload-artifact@v4
with:
name: semantic-diff-summary
path: fixtures/integration/withastro-docs/harness-summary.json
e2e-withastro-docs-visual-diff:
name: E2E Visual Diff (Playwright screenshots)
runs-on: ubuntu-latest
needs: build-and-test
timeout-minutes: 60
if: github.event_name == 'workflow_dispatch' || contains(github.event.pull_request.labels.*.name, 'visual-diff')
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: |
crates/napi/pnpm-lock.yaml
fixtures/integration/withastro-docs/repo/pnpm-lock.yaml
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: swatinem/rust-cache@v2
- name: Install NAPI deps
working-directory: crates/napi
run: pnpm install --frozen-lockfile
- name: Build NAPI binding
working-directory: crates/napi
run: pnpm run build:napi
- name: Clone withastro-docs repository
run: ./scripts/setup-withastro-docs.sh
- name: Install all workspace deps
run: pnpm install --no-frozen-lockfile
- name: Install Playwright
run: npx playwright install chromium
- name: Run Visual Diff
run: pnpm visual:withastro-docs -- --build --routes fixtures/integration/withastro-docs/visual-routes.txt --max-diff 0.01
- name: Upload visual diff artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: visual-diff-results
path: |
fixtures/integration/withastro-docs/visual-diff/summary.json
fixtures/integration/withastro-docs/visual-diff/diff/
e2e-harness:
name: E2E Harness Tests
runs-on: ubuntu-latest
needs: build-and-test
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
cache-dependency-path: |
crates/napi/pnpm-lock.yaml
fixtures/integration/astro-harness/pnpm-lock.yaml
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache Rust dependencies
uses: swatinem/rust-cache@v2
- name: Install NAPI deps and build
working-directory: crates/napi
run: pnpm install --frozen-lockfile && pnpm run build:napi
- name: Install harness dependencies
working-directory: fixtures/integration/astro-harness
run: pnpm install --no-frozen-lockfile
- name: Run E2E harness tests
env:
MARKFLOW_HARNESS_E2E: "1"
run: node fixtures/integration/astro-harness/tests/directives.aside.test.mjs