ci: add GitHub Actions workflow modeled on @grammyjs/conversations

Merged
KN
3mo ago
+119-1

Sets up CI for this repo, mirroring the workflow used by @grammyjs/conversations.

Changes

  • .github/workflows/deno.yml — runs on pushes and PRs targeting main, with four jobs:
    • backport: npm install --ignore-scripts + npm run backport (deno2node build). Adds a setup-node step pinned to Node 24 to match this package's engines requirement — the only structural addition over the conversations workflow.
    • format-and-lint: deno fmt --check and deno lint.
    • test: deno task check + deno task test on a matrix of Ubuntu, macOS, and Windows.
    • coverage: deno task coverage with LCOV upload to Codecov.
  • deno.jsonc — adds the task definitions the workflow relies on (check, test, ok, clean, coverage, report), adapted from conversations to this repo's layout (src/mod.ts, test/), and excludes test/cov_profile from fmt/lint.

Validation

All CI steps were run locally with Deno 2.9.5:

  • deno fmt --check, deno lint, and deno task check pass.
  • deno task test: all 23 tests pass.
  • npm install --ignore-scripts && npm run backport builds out/mod.js and out/mod.d.ts cleanly.

Note: the coverage job uploads to Codecov without a token, which works for public repos on codecov-action@v1 (same as conversations). If uploads are flaky, the action can be bumped to v4+ with a CODECOV_TOKEN secret.


Generated by Claude Code


Summary by cubic

Adds GitHub Actions CI modeled on @grammyjs/conversations. Previously no CI; now pushes and PRs to main run backporting, format/lint, a cross-OS test matrix, and coverage upload via codecov/codecov-action@v7, with restricted permissions.

  • .github/workflows/deno.yml: four jobs — backport (Node 24 via actions/setup-node@v4), format/lint (denoland/setup-deno@v2), tests on Ubuntu/macOS/Windows, and coverage (LCOV upload using codecov/codecov-action@v7); workflow scopes permissions: contents: read and disables checkout credential persistence.
  • deno.jsonc: adds tasks check, test, ok, clean, coverage, report; excludes test/cov_profile from fmt/lint.
  • .gitignore: ignores coverage artifacts (test/coverage, test/cov_profile, coverage.lcov) to align with the clean task.

Summary by CodeRabbit

  • Tests

    • Expanded automated testing across macOS, Windows, and Ubuntu environments.
    • Added test coverage collection and reporting to help maintain reliability.
  • Chores

    • Added automated checks for formatting, linting, and validation on code changes.
    • Added development tasks for running checks, cleaning generated files, and viewing coverage reports.