chore: steal CI from @grammyjs/conversations - #21
Conversation
…ge jobs Mirrors the CI setup of @grammyjs/conversations: a Deno-based workflow running backporting via deno2node, format and lint checks, tests across Linux, macOS, and Windows, and coverage upload to Codecov. Adds the corresponding deno.jsonc tasks (check, test, ok, clean, coverage, report). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XRdjcqbadQ3X3ZpXqEp22M
- Ignore coverage artifacts (test/coverage, test/cov_profile, coverage.lcov) so the git clean -fX based clean task removes them, matching the conversations repo's .gitignore - Restrict the workflow GITHUB_TOKEN to contents: read - Disable checkout credential persistence in all jobs - Upgrade codecov/codecov-action from v1.0.10 (node12-based) to v7 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XRdjcqbadQ3X3ZpXqEp22M
| "test": "deno test --allow-import test", | ||
| "ok": "deno fmt && deno lint && deno task test && deno task check", | ||
| "clean": "git clean -fX out test/cov_profile test/coverage coverage.lcov", | ||
| "coverage": "deno task clean && deno task test --coverage=./test/cov_profile && deno coverage --lcov --output=./coverage.lcov ./test/cov_profile", |
There was a problem hiding this comment.
I think we can directly generate HTML these days, so there's no need for a separate subcommand here. I'm not sure how to reconcile this with CI, though.
There was a problem hiding this comment.
I didn't notice any built-in reporters that lets us directly generate HTML in deno test documentations.
ref: https://docs.deno.com/runtime/reference/cli/test/#reporters
There was a problem hiding this comment.
There was a problem hiding this comment.
So this is to say that we do need a different subcommand but not a different CLI entirely. I stand corrected
There was a problem hiding this comment.
It seems like the coverage subcommand is not needed at all. Now, deno test --coverage generates both the lcov file as well as the html report.
Co-authored-by: KnorpelSenf <shtrog@gmail.com>
Co-authored-by: KnorpelSenf <shtrog@gmail.com>
Updated Deno workflow to use actions/checkout@v7 and changed cache command.
Updated the 'ok' task to remove the check for 'deno task check' and include 'deno test'.
Updated checkout action version and deno commands.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f17c77c48
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a772909c7a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
I took a slightly aggressive approach of trimming |
Note
This PR was primarily written by Claude Code.
Summary
This sets up CI for the validator plugin, mirroring the workflow of @grammyjs/conversations:
main, with four jobs: backporting viadeno2node, format and lint checks, tests across Ubuntu, macOS, and Windows, and coverage upload to Codecovdeno.jsonctasks (check,test,ok,clean,coverage,report)GITHUB_TOKENtocontents: readand disable checkout credential persistence in all jobstest/cov_profile,test/coverage,coverage.lcov) so thegit clean -fXbasedcleantask removes themNote
CodeCov upload requires a token. The CI currently allows it to pass with error. If uploading CodeCov is desired, token needs to be set.
Validation
deno fmt --checkdeno lintdeno test --allow-import testChecklist