Skip to content

fix(render): stop Word blocking on "update the fields?" when it opens a render #127

fix(render): stop Word blocking on "update the fields?" when it opens a render

fix(render): stop Word blocking on "update the fields?" when it opens a render #127

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ci-${{ github.head_ref || github.sha }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
jobs:
check:
name: Lint + Types + Dead Code
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
- run: bun install --frozen-lockfile
- run: bun run check
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
- run: bun install --frozen-lockfile
- run: bun run test:unit
- run: bun run test:benchmark
macos-output:
name: macOS output contract (Bun ${{ matrix.bun-version }})
runs-on: macos-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
bun-version: ["1.3.10", "latest"]
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
with:
bun-version: ${{ matrix.bun-version }}
- run: bun install --frozen-lockfile
- run: bun test tests/cli/output-contract.test.ts
integration-tests:
name: Integration Tests (LibreOffice)
# Pinned, not ubuntu-latest: the OS release decides which LibreOffice apt
# installs, so a silent ubuntu-latest bump would change the renderer under
# test. 26.04 ships LibreOffice 26.2, matching current desktop installs and
# the Windows job's libreoffice-fresh; 24.04 would test against 24.2.
runs-on: ubuntu-26.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
- name: Install LibreOffice
# Normally ~15s. A stalled Azure apt mirror once trickled this for 15+
# minutes (2026-11-06); fail fast and re-run instead of waiting it out.
timeout-minutes: 5
run: |
sudo apt-get update -o Acquire::Retries=3
sudo apt-get install -y --no-install-recommends -o Acquire::Retries=3 libreoffice-core libreoffice-writer fontconfig
- name: Pre-warm fontconfig cache
# Parallel soffice workers race to populate ~/.cache/fontconfig and the
# losers print "Fontconfig error: No writable cache directories" to
# stderr, failing the round-trip test's empty-stderr assertion. One
# serial fc-cache populates the cache so workers just read it.
run: |
mkdir -p "$HOME/.cache/fontconfig"
fc-cache -f
- run: bun install --frozen-lockfile
- run: DOCX_LO_ALL=1 bun run test:integration # full fixture sweep in CI
windows-render:
name: Render through LibreOffice (Windows)
runs-on: windows-latest
timeout-minutes: 20
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
- name: Install LibreOffice
shell: pwsh
run: choco install libreoffice-fresh -y --no-progress --limit-output
- run: bun install --frozen-lockfile
- run: bun test tests/cli/render.test.ts tests/cli/images.test.ts
- run: bun run build:binary
- name: Render with the compiled binary
run: |
./dist/docx render tests/fixtures/markdown-import.docx --out smoke --engine libreoffice --pages 1
test -s smoke/page-001.png
build-binary:
name: Smoke-build compiled binary (${{ matrix.os }})
runs-on: ${{ matrix.os }}
# Covers the Windows leg's informational unit-test step (its own 15-minute cap).
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-15-intel, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- uses: actions/cache@v5
with:
path: ~/.bun/install/cache
key: bun-${{ runner.os }}-${{ hashFiles('bun.lock') }}
restore-keys: bun-${{ runner.os }}-
- run: bun install --frozen-lockfile
- run: bun run build:binary
- name: Sign and verify macOS binary
if: runner.os == 'macOS'
run: sh scripts/sign-macos-binary.sh ./dist/docx
- name: Verify binary runs
# Git Bash on Windows, the shell `docx upgrade` needs there; bash also stops at
# the first failing line, where the default PowerShell would carry on.
shell: bash
run: |
./dist/docx --version
./dist/docx --help > /dev/null
./dist/docx read tests/fixtures/markdown-import.docx > /dev/null
./dist/docx validate tests/fixtures/markdown-import.docx
- name: Verify the installer on a Windows checkout
if: runner.os == 'Windows'
shell: bash
run: bun test tests/cli/installer.test.ts
- name: Unit tests on Windows (informational)
# Known Windows-only failures remain, so this reports without failing the job.
if: runner.os == 'Windows'
continue-on-error: true
timeout-minutes: 15
shell: bash
run: bun run test:unit
- name: Upgrade the compiled binary against a real release
# Runs last: it replaces dist/docx. The version is pinned so that a new release
# can't change what this checks, and only the release's assets are downloaded.
shell: bash
run: |
./dist/docx upgrade --dry-run
./dist/docx upgrade --to v0.28.0
./dist/docx --version | grep -F 0.28.0
- name: Verify the Windows swap
if: runner.os == 'Windows'
shell: bash
run: |
test -f dist/docx.exe.old
test ! -e dist/.docx-upgrade