From 24cdac2a342d83de98a2b45a1f9b1a99ba6b3b2c Mon Sep 17 00:00:00 2001 From: faisalishfaq2005 Date: Mon, 29 Jun 2026 19:03:57 +0500 Subject: [PATCH 1/2] ci: run tests, typecheck and build on push/PR Adds a GitHub Actions workflow running typecheck, tests, and build on Node 18/20/22 for every push to main and every pull request. Adds a CI status badge to the README next to the npm badge. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ci.yml | 17 +++++++++++++++++ README.md | 3 +++ 2 files changed, 20 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..5aede1a --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,17 @@ +name: CI +on: + push: { branches: [main] } + pull_request: +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: { node: [18, 20, 22] } + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: { node-version: '${{ matrix.node }}', cache: npm } + - run: npm ci + - run: npm run typecheck + - run: npm test + - run: npm run build diff --git a/README.md b/README.md index 74d6c41..00b6ea9 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,9 @@ npm + + CI + GitHub stars From b382970a206d1316169b7125feb4cf6b5bc73c91 Mon Sep 17 00:00:00 2001 From: faisalishfaq2005 Date: Mon, 29 Jun 2026 19:16:57 +0500 Subject: [PATCH 2/2] ci: drop Node 18 from test matrix Vitest 4 (via rolldown) imports util.styleText, which only exists in Node 20+, so the Node 18 job fails at startup. Test on Node 20 and 22; Node 18 is end-of-life. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5aede1a..d3e7632 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,7 +6,8 @@ jobs: test: runs-on: ubuntu-latest strategy: - matrix: { node: [18, 20, 22] } + # Vitest 4 (via rolldown) requires Node's util.styleText, added in Node 20. + matrix: { node: [20, 22] } steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4