From 34a466f5ebdb7b6a88ff4e48f44f612baec908e8 Mon Sep 17 00:00:00 2001 From: mpiekunk Date: Mon, 21 Sep 2026 16:37:38 -0400 Subject: [PATCH] ci(EN-11822): make build and test targets CI-ready Split the Makefile into developer entry points and leaf targets. The entry points keep their existing prerequisite chains; the leaf targets declare none, so CI can install once with npm ci and run each step without npm install running again. ci-unit-test writes a JUnit report for CircleCI Test Insights. --- .gitignore | 1 + Makefile | 34 ++++++++++++++++++++++++++++------ tsconfig.json | 2 +- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 25ef33c..a497ccc 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules build .env +reports diff --git a/Makefile b/Makefile index 694dd66..54f1f63 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,12 @@ .DEFAULT_GOAL := build +# build and test rely on their prerequisites running in order. +.NOTPARALLEL: + +.PHONY: install hooks inspector build compile typecheck bundle \ + test unit-test ci-install ci-unit-test publish bump + install: hooks npm install @@ -11,16 +17,32 @@ hooks: inspector: npx -y @modelcontextprotocol/inspector npx -y tsx src/main.ts -build: install - npx tsc --noEmit \ - && npx esbuild src/main.ts --bundle --platform=node --format=esm --banner:js='#!/usr/bin/env node' --outfile=build/main.mjs \ - && chmod +x build/main.mjs +build: install compile -test: build - npx vitest run +test: build unit-test publish: test npm publish bump: @node scripts/bump-version.mjs $(VERSION) + +ci-install: + npm ci + +typecheck: + npx tsc --noEmit + +bundle: + npx esbuild src/main.ts --bundle --platform=node --format=esm \ + --banner:js='#!/usr/bin/env node' --outfile=build/main.mjs + chmod +x build/main.mjs + +compile: typecheck bundle + +unit-test: + npx vitest run + +ci-unit-test: + npx vitest run --reporter=default \ + --reporter=junit --outputFile.junit=reports/junit/results.xml diff --git a/tsconfig.json b/tsconfig.json index 97b747c..d606268 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -110,5 +110,5 @@ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ "skipLibCheck": true /* Skip type checking all .d.ts files. */ }, - "exclude": [] + "exclude": ["node_modules", "build"] }