From 6174a63a03059eefa29918a7b4a7e7bb45d5f9ba Mon Sep 17 00:00:00 2001 From: idanlodzki Date: Sat, 1 Aug 2026 22:33:01 +0300 Subject: [PATCH] ci: add build + typecheck workflow and fix link-check Node version Nothing in CI built or typechecked this repo, so a PR could go green and still be broken. Dependabot's TypeScript 7 bump (#113) is a live example: Vercel passes it because the Docusaurus build never runs tsc, but `npm run typecheck` fails on it with TS5102 (baseUrl removed). Add a CI workflow running typecheck and build on every PR and push to main. While here: the existing link-check workflow has been failing at its "Build documentation" step for about three months. It pins node-version 18, but @docusaurus/core 3.10 declares engines.node >=20, so the build could never succeed. Bumped it to 24 to match opsimate-docs/dockerfile, and corrected the stale engines.node in opsimate-docs/package.json, which still claimed >=18.0. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/ci.yml | 35 ++++++++++++++++++++++++++++++++ .github/workflows/link-check.yml | 2 +- opsimate-docs/package.json | 2 +- 3 files changed, 37 insertions(+), 2 deletions(-) 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..ac46147 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,35 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + build: + name: Build and typecheck + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v7 + + - name: Setup Node.js + uses: actions/setup-node@v7 + with: + # Matches opsimate-docs/dockerfile. Docusaurus 3.10 requires >=20, + # so this must stay on a supported LTS line. + node-version: '24' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Typecheck + working-directory: ./opsimate-docs + run: npm run typecheck + + - name: Build + run: npm run build diff --git a/.github/workflows/link-check.yml b/.github/workflows/link-check.yml index 6f34fdf..4787d37 100644 --- a/.github/workflows/link-check.yml +++ b/.github/workflows/link-check.yml @@ -28,7 +28,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v7 with: - node-version: '18' + node-version: '24' cache: 'npm' cache-dependency-path: 'opsimate-docs/package-lock.json' diff --git a/opsimate-docs/package.json b/opsimate-docs/package.json index af79e6a..92952d1 100644 --- a/opsimate-docs/package.json +++ b/opsimate-docs/package.json @@ -46,6 +46,6 @@ ] }, "engines": { - "node": ">=18.0" + "node": ">=20.0" } }