mirror of
https://github.com/dolanmiu/docx.git
synced 2026-12-01 16:55:59 +01:00
50 lines
1.9 KiB
YAML
50 lines
1.9 KiB
YAML
name: Shape demos
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
render:
|
|
name: Validate, render and compare shape demos
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: "./.github/actions/install-and-build"
|
|
- uses: docker/setup-buildx-action@v3
|
|
# The pinned LibreOffice and fonts the reference images were drawn with
|
|
- name: Build the image the pages are drawn in
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
context: scripts/shape-demos
|
|
platforms: linux/amd64
|
|
tags: docx-shape-renderer
|
|
load: true
|
|
cache-from: type=gha,scope=shape-renderer
|
|
cache-to: type=gha,mode=max,scope=shape-renderer
|
|
- name: Run, validate and render the shape demos
|
|
run: scripts/render-shape-demos.sh build/shape-demos
|
|
env:
|
|
SHAPE_RENDER_IMAGE: docx-shape-renderer
|
|
- name: Compare the pages with the reference images
|
|
run: npm run run-ts -- scripts/compare-shape-renders.ts build/shape-demos
|
|
# The layout demos' tables of contents have their page numbers from docx/layout. Each should be the page the
|
|
# same image's LibreOffice puts the heading on
|
|
- name: Compare docx/layout's page numbers with LibreOffice's
|
|
run: scripts/compare-layout.sh build/layout
|
|
env:
|
|
SHAPE_RENDER_IMAGE: docx-shape-renderer
|
|
- name: Upload the pages and their differences
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: shape-demos
|
|
path: build/shape-demos
|
|
if-no-files-found: warn
|