From bc2f1fc1e79682d49bd10a1440779b0eb595e85f Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Mon, 20 Apr 2026 05:34:24 +0800 Subject: [PATCH] ci(make-pdf): matrix copy-paste gate on Ubuntu + macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Runs the combined-features P0 gate on pull requests that touch make-pdf/ or browse's PDF surface. Installs poppler (macOS) / poppler-utils (Ubuntu) per OS. Windows deferred to tolerant mode (Xpdf / Poppler-Windows extraction variance not yet calibrated against the normalized comparator — Codex round 2 #18). Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/make-pdf-gate.yml | 80 +++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 .github/workflows/make-pdf-gate.yml diff --git a/.github/workflows/make-pdf-gate.yml b/.github/workflows/make-pdf-gate.yml new file mode 100644 index 00000000..eab5c4fb --- /dev/null +++ b/.github/workflows/make-pdf-gate.yml @@ -0,0 +1,80 @@ +name: make-pdf copy-paste gate +on: + pull_request: + branches: [main] + paths: + - 'make-pdf/**' + - 'browse/src/meta-commands.ts' + - 'browse/src/write-commands.ts' + - 'browse/src/commands.ts' + - 'browse/src/cli.ts' + - 'scripts/resolvers/make-pdf.ts' + - 'package.json' + - '.github/workflows/make-pdf-gate.yml' + workflow_dispatch: + +concurrency: + group: make-pdf-gate-${{ github.head_ref }} + cancel-in-progress: true + +jobs: + gate: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + # Windows is tolerant-mode — Xpdf / Poppler-Windows extraction + # differs enough from the Linux/macOS baseline that the strict + # exact-diff gate is unreliable. Enable once the normalized + # comparator proves tolerant enough (Codex round 2 #18). + # + # include: + # - os: windows-latest + # tolerant: true + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + + - uses: oven-sh/setup-bun@v2 + with: + bun-version: latest + + - name: Install dependencies + run: bun install --frozen-lockfile + + - name: Install poppler (macOS) + if: matrix.os == 'macos-latest' + run: brew install poppler + + - name: Install poppler-utils (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: sudo apt-get update && sudo apt-get install -y poppler-utils + + - name: Install Playwright Chromium + run: bunx playwright install chromium + + - name: Build binaries + run: bun run build + + - name: ad-hoc codesign (Apple Silicon) + if: matrix.os == 'macos-latest' + run: | + for bin in browse/dist/browse browse/dist/find-browse design/dist/design make-pdf/dist/pdf; do + codesign --remove-signature "$bin" 2>/dev/null || true + codesign -s - -f "$bin" || true + done + + - name: Log toolchain versions + run: | + echo "OS: ${{ matrix.os }}" + bun --version + which pdftotext && pdftotext -v 2>&1 | head -1 || true + + - name: Run make-pdf unit tests + run: bun test make-pdf/test/*.test.ts + + - name: Run combined-features copy-paste gate (P0) + env: + BROWSE_BIN: ${{ github.workspace }}/browse/dist/browse + run: bun test make-pdf/test/e2e/combined-gate.test.ts