Skip to content

ci: add build, lint and bundle size check workflow#38

Open
Ri1tik wants to merge 3 commits intoAOSSIE-Org:mainfrom
Ri1tik:ci/build-lint-bundle-check
Open

ci: add build, lint and bundle size check workflow#38
Ri1tik wants to merge 3 commits intoAOSSIE-Org:mainfrom
Ri1tik:ci/build-lint-bundle-check

Conversation

@Ri1tik
Copy link

@Ri1tik Ri1tik commented Mar 7, 2026

Addressed Issues:

Fixes #37

Screenshots/Recordings:

No UI changes — CI workflow only.

Tested locally before opening this PR:

Build output:
Screenshot 2026-03-07 182451

Lint output:
No errors, no warnings
Screenshot 2026-03-07 182730

Additional Notes:

Job 1 ──┐
               ├── parallel
Job 2 ──┘
         
Job 3 waits for Job 1 → downloads artifact → checks size

Checklist

  • My code follows the project's code style and conventions
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contributing Guidelines

⚠️ AI Notice - Important!

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact.

Summary by CodeRabbit

  • Chores
    • Added an automated CI pipeline to build the project, run type checks, and perform linting on changes.
    • Implemented bundle-size monitoring with a configurable threshold and warnings when the build exceeds the size limit.

@coderabbitai
Copy link

coderabbitai bot commented Mar 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3395a330-a02b-448e-9992-511cfabc1060

📥 Commits

Reviewing files that changed from the base of the PR and between 4eacebc and ebb925b.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

Walkthrough

A GitHub Actions CI workflow was added at .github/workflows/ci.yml providing three concurrent jobs on push and pull_request: Build & type-check (build + upload dist/ artifact), Lint, and Bundle Size Check (downloads artifact and warns if >500 KB).

Changes

Cohort / File(s) Summary
GitHub Actions CI Workflow
/.github/workflows/ci.yml
Adds a CI workflow with three parallel jobs: Build & Type Check (Node.js 20, npm ci, npm run build, uploads dist/ artifact with 7-day retention), Lint (Node.js 20, npm ci, npm run lint), and Bundle Size Check (downloads dist artifact, compares size against 500 KB threshold, logs warning if exceeded).

Sequence Diagram(s)

sequenceDiagram
    participant PR as Pull Request
    participant GH as GitHub Actions
    participant Runner as Runner
    participant NPM as npm Registry
    participant Art as Artifact Storage
    participant Checker as Bundle Size Check

    PR->>GH: push / pull_request event
    GH->>Runner: start Build job
    GH->>Runner: start Lint job
    GH->>Runner: start Bundle Size job (waits for artifact)
    Runner->>Runner: checkout repo
    Runner->>NPM: npm ci
    Runner->>Runner: run build (tsc/vite)
    Runner->>Art: upload `dist/` artifact
    Art-->>Checker: artifact available
    Checker->>Art: download `dist/`
    Checker->>Checker: measure bundle size
    Checker->>GH: post warning or success
    Runner->>GH: Lint job posts results
    Runner->>GH: Build job posts results and artifact metadata
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

Linter

Suggested reviewers

  • Zahnentferner

Poem

🐰 Pipelines hop with joyous cheer,
Build and lint now appear,
Artifacts tucked in storage neat,
Bundle checks keep sizes fleet,
A rabbit twirls — CI is complete.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The pull request title clearly and concisely summarizes the main change: adding a CI workflow for build, lint, and bundle size checks, which is the primary focus of the changeset.
Linked Issues check ✅ Passed The pull request successfully implements all three requirements from issue #37: build and type check via tsc and vite, lint check via eslint, and bundle size verification with 500 KB threshold.
Out of Scope Changes check ✅ Passed All changes are within scope—the PR adds only the GitHub Actions CI workflow file (.github/workflows/ci.yml) as specified in issue #37, with no unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions bot added size/M and removed size/M labels Mar 7, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 72-82: Update the "Check bundle size" workflow step to emit a
GitHub Actions annotation and make the threshold configurable: read the bundle
size into BUNDLE_SIZE (as currently done), introduce an environment variable
BUNDLE_SIZE_THRESHOLD (default 500) for the threshold, and when BUNDLE_SIZE is
greater than BUNDLE_SIZE_THRESHOLD use the workflow command ::warning:: to
output the annotated warning (e.g., "::warning::Bundle size ${BUNDLE_SIZE}KB
exceeds ${BUNDLE_SIZE_THRESHOLD}KB threshold") instead of a plain echo; keep the
existing success message path unchanged and retain the "Check bundle size" step
name and BUNDLE_SIZE variable usage so the change is localized.
- Around line 1-8: The CI workflow named "CI" lacks concurrency control and job
timeouts; add a top-level concurrency section (e.g., concurrency: { group:
github.ref, cancel-in-progress: true }) to cancel redundant runs for the same
ref/PR, and add timeout-minutes: 10 (or another suitable value) to each job
definition so individual jobs cannot hang indefinitely—update the workflow "CI"
file to include these keys adjacent to the existing name/on sections and inside
each job block.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c5fd49ed-8bd3-46aa-a7f3-5466aaf878ca

📥 Commits

Reviewing files that changed from the base of the PR and between 1cfc3e7 and 3cfcd0c.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

@github-actions github-actions bot added size/M and removed size/M labels Mar 7, 2026
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 79-88: The "Check bundle size" step currently uses `du -sk` which
reports allocated blocks; change the BUNDLE_SIZE calculation to sum actual file
bytes in the dist/ tree (e.g. use `find dist -type f -print0` piped to `xargs -0
stat --format=%s` and sum, or `find ... -print0 | xargs -0 wc -c`), assign that
result to BUNDLE_SIZE, and keep the existing threshold logic
(BUNDLE_SIZE_THRESHOLD, the echo/warning branches) so the comparison uses real
byte counts rather than filesystem allocation sizes.
- Around line 1-13: Add an explicit top-level permissions block to the workflow
to restrict the GITHUB_TOKEN to read-only repository contents: insert a
permissions: contents: read entry at the top-level of the CI workflow (the YAML
that defines name: CI and on: ...) so the workflow only grants read access
instead of inheriting broader repo defaults; ensure the permissions key is
aligned with the workflow root and not nested under jobs or steps.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ae5d0449-9c74-429f-9bfd-20bb3ad321b9

📥 Commits

Reviewing files that changed from the base of the PR and between 3cfcd0c and 4eacebc.

📒 Files selected for processing (1)
  • .github/workflows/ci.yml

@github-actions github-actions bot added size/M and removed size/M labels Mar 7, 2026
@Ri1tik
Copy link
Author

Ri1tik commented Mar 7, 2026

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented Mar 7, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@github-actions github-actions bot added size/M and removed size/M labels Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add CI workflow for build, lint and bundle size verification

1 participant