ci: add PR test workflow for Discord toolkit + worker#9
Open
rz1989s wants to merge 1 commit into
Open
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
CIworkflow that runs the test suites for both npm packages in this repo on every PR and push tomain:/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
/discordand/discord/workerwere landing unverified. This makes them verifiable.Drive-by fix
The toolkit's
testscript was a barenode --test, which recursed intodiscord/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 tonode --test test/*.test.jssonpm testis 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 faileddiscord/worker:npm ci && npm test→ 33 passed, 0 failedRefs sip-protocol/sip-protocol#1186