Skip to content

chore(release): version packages (#298) #733

chore(release): version packages (#298)

chore(release): version packages (#298) #733

Workflow file for this run

name: CI
# Quality gate for the project. Adapt the steps below to the language / package
# manager of the project that uses this template.
#
# Defaults assume Node.js + pnpm. For other stacks (Cargo, Python, Go, ...),
# replace the install / typecheck / lint / test / build steps accordingly. The
# overall structure (cheap static gate, then test matrix) is stack-agnostic and
# worth keeping.
on:
push:
branches: [main]
pull_request:
branches: [main]
# Cancel in-flight runs on the same ref so a fast-forward push doesn't spend
# minutes on stale CI.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
# Cheap, single-version gate. Catches typing / lint / format violations before
# the test matrix spins up.
static:
name: Static checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# TEMPLATE: replace the toolchain setup below for non-Node stacks.
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 24.16.0
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Format check
run: pnpm format:check
- name: Lint
run: pnpm lint
- name: Type check
run: pnpm typecheck
- name: Build
run: pnpm build
# The @office-kit/pptx-preview companion package type-checks and builds against
# @office-kit/pptx's emitted types, so these run after the root build. It's a
# separate workspace package with its own tsconfig / tsdown config.
- name: Type check preview package
run: pnpm --filter @office-kit/pptx-preview typecheck
- name: Build preview package
run: pnpm --filter @office-kit/pptx-preview build
# Multi-version test matrix. Adapt the matrix to the runtimes the project
# supports. Drop versions that are past their EOL date.
test:
name: Test (Node ${{ matrix.node-version }})
needs: static
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: ['22', '24', '26']
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm test
# Measures how closely @office-kit/pptx-preview's SVG renderer matches LibreOffice's
# output for each generated sample slide, and gates on a committed baseline.
fidelity:
name: Preview fidelity
needs: static
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
# ground truth = LibreOffice PDF export rasterized by pdftoppm.
# --no-install-recommends skips LibreOffice's font packages, so install
# the metric-compatible families explicitly — they're the same ones
# @office-kit/pptx-preview bundles (Carlito≈Calibri, Caladea≈Cambria,
# Liberation≈Arial/Times/Courier). Without them LibreOffice falls back
# to whatever fontconfig scrapes up and every text slide's fg-SSIM
# collapses to ~0.
- name: Install LibreOffice, poppler, and fonts
run: >
sudo apt-get update && sudo apt-get install -y --no-install-recommends
libreoffice-impress poppler-utils
fonts-crosextra-carlito fonts-crosextra-caladea fonts-liberation
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 24.16.0
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Build @office-kit/pptx
run: pnpm build
- name: Build preview package
run: pnpm --filter @office-kit/pptx-preview build
- name: Generate sample PPTX files
run: pnpm samples
- name: Run fidelity harness
run: pnpm --filter @office-kit/pptx-site fidelity -- --check
- name: Upload fidelity report
if: always()
uses: actions/upload-artifact@v7
with:
name: fidelity-report
path: site/fidelity/out/
retention-days: 7
if-no-files-found: ignore
- name: Upload baseline candidate
if: always()
uses: actions/upload-artifact@v7
with:
name: fidelity-baseline-candidate
path: site/fidelity/baseline.candidate.json
retention-days: 7
if-no-files-found: ignore
# Secondary OOXML oracle. xmllint + the ECMA-376 XSDs (run in the test job)
# only check structural schema conformance; they can't express the semantic
# OOXML rules PowerPoint enforces before it calls a file corrupt. This job
# runs Microsoft's own OpenXmlValidator over the generated decks as an
# independent check. It GATES — CLAUDE.md treats invalid output as a bug, so a
# real validation error must fail the build, not just warn.
ooxml-oracle:
name: OOXML validator (Open XML SDK)
needs: static
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 24.16.0
cache: pnpm
# SDK feature band is pinned in tools/ooxml-validate/global.json so the
# validator's rule set is reproducible.
- uses: actions/setup-dotnet@v4
with:
global-json-file: tools/ooxml-validate/global.json
- run: pnpm install --frozen-lockfile
- name: Build @office-kit/pptx
run: pnpm build
- name: Generate sample PPTX files
run: pnpm samples
- name: Validate samples with OpenXmlValidator
run: dotnet run --project tools/ooxml-validate -c Release -- samples/out