Skip to content

ci: add PR test workflow for Discord toolkit + worker#9

Open
rz1989s wants to merge 1 commit into
mainfrom
chore/add-pr-ci
Open

ci: add PR test workflow for Discord toolkit + worker#9
rz1989s wants to merge 1 commit into
mainfrom
chore/add-pr-ci

Conversation

@rz1989s

@rz1989s rz1989s commented Jun 19, 2026

Copy link
Copy Markdown
Member

What

Adds a CI workflow that runs the test suites for both npm packages in this repo on every PR and push to main:

  • /discord — the Discord infra-as-code toolkit (40 tests)
  • /discord/worker — the interactions Cloudflare Worker (33 tests)

Matrix job: npm ci && npm test (node --test) per package, with npm caching scoped to each lockfile.

Why

Per the org Dependabot audit (sip-protocol/sip-protocol#1186), this repo had no PR CI — Dependabot npm bumps in /discord and /discord/worker were landing unverified. This makes them verifiable.

Drive-by fix

The toolkit's test script was a bare node --test, which recursed into discord/worker/test/ — those tests need the worker's own dependencies (discord-interactions) and fail when run from the toolkit package (which doesn't install them). Scoped it to node --test test/*.test.js so npm test is correct both locally and in CI. The worker's own script is unchanged (it runs correctly from its own package).

Verification

Ran locally exactly as CI does:

  • discord: npm ci && npm test → 40 passed, 0 failed
  • discord/worker: npm ci && npm test → 33 passed, 0 failed

Refs sip-protocol/sip-protocol#1186

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant