diff --git a/.github/workflows/ci.js.yml b/.github/workflows/ci.js.yml index 7ec8647c..0efb7c56 100644 --- a/.github/workflows/ci.js.yml +++ b/.github/workflows/ci.js.yml @@ -40,3 +40,4 @@ jobs: cache-dependency-path: "typescript/package-lock.json" - run: npm ci - run: npm run build-all + - run: npm test diff --git a/tools/tests/node-ci.test.mjs b/tools/tests/node-ci.test.mjs new file mode 100644 index 00000000..60d51f83 --- /dev/null +++ b/tools/tests/node-ci.test.mjs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +import assert from "node:assert/strict"; +import fs from "node:fs"; +import test from "node:test"; +import { parse } from "yaml"; + +const workflow = parse(fs.readFileSync(new URL("../../.github/workflows/ci.js.yml", import.meta.url), "utf8")); + +test("Node CI runs the full TypeScript test suite in its build matrix", () => { + assert.equal(workflow.defaults.run["working-directory"], "typescript"); + const build = workflow.jobs.build; + const runSteps = build.steps.filter(step => Object.hasOwn(step, "run")); + assert.deepEqual(runSteps.map(step => step.run), ["npm ci", "npm run build-all", "npm test"]); + assert.equal(build["continue-on-error"] ?? false, false); + const testStep = runSteps.at(-1); + assert.equal(testStep.if, undefined); + assert.equal(testStep["working-directory"], undefined); + assert.equal(testStep["continue-on-error"] ?? false, false); +}); diff --git a/typescript/README.md b/typescript/README.md index ef06f95e..06f37b22 100644 --- a/typescript/README.md +++ b/typescript/README.md @@ -38,6 +38,8 @@ npm run build Run the test suite with `npm test`. The Zod schema tests also compile their generated TypeScript schema text to check for syntax errors and unresolved type references. +Node.js CI runs this suite across its Node.js matrix after a clean dependency +installation and workspace build. To see TypeChat in action, we recommend exploring the [TypeChat example projects](https://github.com/microsoft/TypeChat/tree/main/typescript/examples). You can try them on your local machine or in a GitHub Codespace.