Skip to content

Add CI: oxlint, oxfmt, Playwright E2E + GitHub Actions#9

Merged
finallyjay merged 1 commit into
mainfrom
add-ci-lint-tests
Jun 3, 2026
Merged

Add CI: oxlint, oxfmt, Playwright E2E + GitHub Actions#9
finallyjay merged 1 commit into
mainfrom
add-ci-lint-tests

Conversation

@finallyjay
Copy link
Copy Markdown
Owner

@finallyjay finallyjay commented Jun 3, 2026

Sets up automated quality gates that run on every pull request.

What's included

  • oxlint (.oxlintrc.json) — fast Rust linter over src/tests (npm run lint)
  • oxfmt (.oxfmtrc.json) — Rust formatter for JS/TS/CSS/MD (npm run format / format:check). Skips .astro (oxfmt alpha doesn't support it yet).
  • Playwright E2E (playwright.config.ts + tests/e2e/) — smoke tests for the fully client-side demo flow: hub renders, demo loads with a full chamber, spin → WANTED verdict, sparing pardons a bookmark and shrinks the chamber.
  • GitHub Actions (.github/workflows/ci.yml) — runs lint + format:check + build + test on each PR.

Notes

  • CI triggers on pull_request onlymain is protected so code lands via PRs (validated here), and Vercel handles build & deploy on push. No redundant post-merge run.
  • oxfmt normalized src/styles/global.css (formatting only, no visual change — build + E2E green).
  • Rewrote a ternary-used-as-statement in roulette.astro to satisfy oxlint's no-unused-expressions.

After merge, the ci check will be marked as a required status check on main.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests

    • Added comprehensive end-to-end tests for roulette game and homepage features to ensure reliability.
  • Chores

    • Established automated code quality checks that run on every pull request to maintain code standards.
    • Integrated end-to-end testing framework for improved application stability and quality assurance.

Sets up PR quality gates for the project:

- oxlint (.oxlintrc.json) — fast Rust linter over src/tests
- oxfmt (.oxfmtrc.json) — Rust formatter; normalizes JS/TS/CSS/MD
  (skips .astro, which oxfmt does not support yet)
- Playwright E2E (playwright.config.ts + tests/e2e) — smoke tests for
  the fully client-side demo flow (load, spin → verdict, spare)
- .github/workflows/ci.yml — runs lint + format:check + build + e2e on
  every pull request (Vercel still handles build & deploy on push)
- npm scripts: lint, format, format:check, test
- Rewrote a ternary-as-statement in roulette.astro to satisfy oxlint
- gitignore Playwright artifacts; document the workflow in CONTRIBUTING

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 3, 2026 19:50
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
daily-dev-roulette Ready Ready Preview, Comment Jun 3, 2026 7:50pm

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 4aa37beb-0076-4416-a5bd-0c6be2e09333

📥 Commits

Reviewing files that changed from the base of the PR and between 185bbeb and 415272d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (12)
  • .github/workflows/ci.yml
  • .gitignore
  • .oxfmtrc.json
  • .oxlintrc.json
  • CONTRIBUTING.md
  • package.json
  • playwright.config.ts
  • src/lib/daily.ts
  • src/pages/roulette.astro
  • src/styles/global.css
  • tests/e2e/demo-roulette.spec.ts
  • tests/e2e/home.spec.ts

📝 Walkthrough

Walkthrough

This pull request establishes comprehensive code quality and E2E testing infrastructure. It introduces oxlint and oxfmt configuration, adds npm scripts for linting and formatting, sets up a GitHub Actions CI workflow to enforce these checks on pull requests, creates Playwright E2E testing configuration and test coverage for key user flows, updates developer documentation, and applies the new formatting standards to existing source files.

Changes

Code Quality and Testing Infrastructure

Layer / File(s) Summary
Linting and formatting tools configuration
.oxlintrc.json, .oxfmtrc.json, package.json
Oxlint rules (correctness/error, suspicious/warn) and oxfmt ignore patterns are configured; package.json adds lint, format, and format:check npm scripts with oxlint and oxfmt devDependencies.
CI enforcement and developer guidance
.github/workflows/ci.yml, .gitignore, CONTRIBUTING.md
GitHub Actions CI enforces lint, format check, and build on PRs with concurrency control; .gitignore excludes Playwright test artifacts; CONTRIBUTING.md documents the new automated lint/format/test workflow for contributors.
E2E testing infrastructure and coverage
playwright.config.ts, tests/e2e/demo-roulette.spec.ts, tests/e2e/home.spec.ts
Playwright configuration enables E2E tests in ./tests/e2e with Chromium, computed local baseURL, trace collection, and dev server startup; new test suites verify home page layout/sign-in UI, demo navigation to /roulette?demo=1, roulette spin/verdict flow, and state changes after user actions.
Code formatting standardization
src/styles/global.css, src/lib/daily.ts, src/pages/roulette.astro
CSS selectors and properties in global.css are expanded to multi-line declarations; daily.ts BookmarksPage type and moveBookmark function signature are reformatted; roulette.astro audio logic converted from ternary to explicit if/else branch.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A workflow springs forth, tests align,
Linting and formatting intertwine,
E2E checks the roulette's spin,
Code quality standards all fall in!
Infrastructure built, now hopping within! 🎪

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch add-ci-lint-tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@finallyjay finallyjay merged commit ea7b943 into main Jun 3, 2026
4 of 5 checks passed
@finallyjay finallyjay deleted the add-ci-lint-tests branch June 3, 2026 19:52
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds automated quality gates (lint/format/build/E2E) to ensure pull requests are validated consistently before merge, alongside a small code tweak to satisfy the new linter and a formatting-only CSS normalization.

Changes:

  • Add Playwright E2E smoke coverage for the hub page and demo roulette flow.
  • Add oxlint/oxfmt scripts + configs and wire them into a new GitHub Actions CI workflow.
  • Apply formatting and a small control-flow refactor to comply with the new tooling.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
.github/workflows/ci.yml Adds PR-only CI job running lint, format check, build, and Playwright E2E with artifact upload.
.gitignore Ignores Playwright reports/results and related cache artifacts.
.oxfmtrc.json Configures oxfmt and ignores unsupported/undesired paths (incl. lockfile).
.oxlintrc.json Configures oxlint severity categories and ignored paths.
CONTRIBUTING.md Documents the new local/CI lint/format/test expectations.
package-lock.json Locks new tooling/test dependencies (Playwright, oxlint, oxfmt).
package.json Adds lint, format, format:check, and test scripts and new devDependencies.
playwright.config.ts Introduces Playwright configuration targeting the Astro dev server.
src/lib/daily.ts Formatting-only changes (type/function signature wrapping).
src/pages/roulette.astro Replaces a ternary-as-statement with an if/else to satisfy oxlint.
src/styles/global.css Formatting-only normalization of existing CSS rules.
tests/e2e/demo-roulette.spec.ts Adds demo roulette E2E tests for chamber load, spin verdict, and sparing behavior.
tests/e2e/home.spec.ts Adds hub page E2E tests for logged-out UI and demo link navigation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread playwright.config.ts
},
],
webServer: {
command: "npm run dev",
Comment thread package.json
Comment on lines 5 to +6
"license": "MIT",
"type": "module",
Comment thread package.json
Comment on lines +23 to 28
"@playwright/test": "^1.60.0",
"@tailwindcss/vite": "^4.3.0",
"oxfmt": "^0.53.0",
"oxlint": "^1.68.0",
"playwright": "^1.60.0",
"tailwindcss": "^4.3.0"
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.

2 participants