From 6c0d11cc5288882cc6cdaf747e90f3dd8dad2b20 Mon Sep 17 00:00:00 2001 From: shadowbrush Date: Mon, 6 Jul 2026 00:56:33 +0000 Subject: [PATCH] ci: add typecheck/test/build gate on PR and main MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Komodo builds + redeploys this service's image on every push to main (Deployment redeploy_on_build) with no check in between, so a broken merge ships straight to the alpha container. There was no CI at all. Add a GitHub Actions workflow that runs typecheck, tests, and a full tsc build on every PR and on main. Puppeteer's Chromium download is skipped (PUPPETEER_SKIP_DOWNLOAD) for speed/reliability — the render tests already self-skip when Chromium can't launch, so the suite stays green and fast while still covering the html/pdf/markdown conversion logic (incl. the html-to-markdown route from hadron-server#503). Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..75046d4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI + +# Gate for hadrontool-pdf. Komodo builds + deploys this service's image on +# every push to `main` (Deployment "redeploy_on_build"), with no other check +# in between — so a broken merge ships straight to the alpha container. This +# workflow is that missing check: typecheck, tests, and a full `tsc` build run +# on every PR and on `main`, so a regression fails here before it can deploy. +# +# (Context: issue hadron-server#503 — the html-to-markdown route was merged but +# never validated/redeployed. This closes the "no gate" half of that gap.) + +on: + pull_request: + push: + branches: [main] + +# Cancel superseded runs on the same ref (e.g. rapid pushes to a PR branch). +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + build-test: + runs-on: ubuntu-latest + env: + # Puppeteer is a dependency (markdown->PDF), but its Chromium download is + # heavy and network-flaky in CI. Skip it: the render tests self-skip when + # Chromium can't launch (src/routes/convert.test.ts), so `npm ci` and the + # rest of the suite stay fast and reliable. To exercise the render path + # here later, drop this and add `npx puppeteer browsers install chrome`. + PUPPETEER_SKIP_DOWNLOAD: 'true' + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Typecheck + run: npm run typecheck + + - name: Test + run: npm test + + - name: Build + run: npm run build