From 371203e9fedccfe632fb306be74276c9a5dbea7b Mon Sep 17 00:00:00 2001 From: RECTOR Date: Fri, 19 Jun 2026 10:56:16 +0700 Subject: [PATCH] ci: add PR test workflow for Discord toolkit + worker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Neither package had PR CI, so Dependabot npm bumps in /discord and /discord/worker landed unverified. Add a matrix workflow that runs npm ci && npm test (node --test) for each package on PRs and pushes to main. Also scope the toolkit's test script to test/*.test.js — the bare node --test recursed into discord/worker/test, whose tests need the worker's own dependencies and failed when run from the toolkit package. Refs sip-protocol/sip-protocol#1186 --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ discord/package.json | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) 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..ba74230 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: CI + +on: + pull_request: + push: + branches: [main] + +permissions: + contents: read + +jobs: + test: + name: test (${{ matrix.dir }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + dir: + - discord + - discord/worker + defaults: + run: + working-directory: ${{ matrix.dir }} + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + cache-dependency-path: ${{ matrix.dir }}/package-lock.json + - run: npm ci + - run: npm test diff --git a/discord/package.json b/discord/package.json index 49c0583..b6a4a75 100644 --- a/discord/package.json +++ b/discord/package.json @@ -4,7 +4,7 @@ "description": "SIP Protocol Discord infra-as-code toolkit", "engines": { "node": ">=18" }, "scripts": { - "test": "node --test", + "test": "node --test test/*.test.js", "render": "node render.js" }, "devDependencies": {