Skip to content

feat: configure CI and pages for storybook tests#2

Merged
Guria merged 1 commit into
mainfrom
github-actions
Jan 25, 2026
Merged

feat: configure CI and pages for storybook tests#2
Guria merged 1 commit into
mainfrom
github-actions

Conversation

@Guria
Copy link
Copy Markdown
Owner

@Guria Guria commented Jan 25, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Storybook now available on GitHub Pages for live access to component documentation.
  • Documentation

    • Added Live section with deployment URLs and CI/CD workflow details in README.
  • Chores

    • Configured automated testing and deployment workflows.
    • Enhanced build configuration for CI/CD environments.
    • Added test coverage reporting.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings January 25, 2026 02:05
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 25, 2026

Warning

Rate limit exceeded

@Guria has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 15 minutes and 15 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

These changes establish comprehensive CI/CD infrastructure via GitHub Actions workflows for automated testing and GitHub Pages deployment. Vite and Vitest configurations are updated to handle dynamic base paths and CI-aware timeouts, while supporting coverage reporting. Build tooling specification and documentation are added to reflect the new deployment capabilities.

Changes

Cohort / File(s) Summary
CI/CD Workflows
.github/workflows/storybook-deploy.yml, .github/workflows/test.yml
New workflows for automated testing (type checking, linting, format validation, Storybook tests with coverage) and GitHub Pages deployment; build and deploy jobs with artifact handling and coverage reporting
Build Configuration
vite.config.ts, .storybook/main.ts
Vite config refactored to function-based with CI-aware base path computation; Storybook config adds viteFinal hook for conditional base path in CI/production
Test Configuration
vitest.config.ts
Enhanced with CI environment detection, configurable timeouts/browser launch options, Playwright Chromium setup, and comprehensive coverage configuration with thresholds and reporters
Tool Versioning & Scripts
mise.toml, package.json
New mise.toml pins Bun v1.1.38; package.json adds test:coverage script for Vitest coverage execution
Documentation & Metadata
README.md
New Live section with deployment URLs and expanded CI/CD section detailing workflow purposes, shared tooling (Bun, Playwright, Modern GH Actions), and configuration paths
Source Code
src/reatom.init.ts
Descriptive comment added before clearStack() invocation; no functional behavior change

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 With workflows deployed and bases set right,
Tests run by day and deploys by night,
Coverage reports shine bright and clear,
Your Storybook lives without any fear,
CI/CD magic—no more manual fight! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: configure CI and pages for storybook tests' clearly summarizes the main changes: adding CI/CD workflows and GitHub Pages configuration for Storybook testing.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


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.

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 configures comprehensive CI/CD infrastructure for the project, including automated testing, coverage reporting, and deployment to GitHub Pages for both the application and Storybook documentation.

Changes:

  • Added GitHub Actions workflows for testing (with coverage) and deployment to GitHub Pages
  • Configured Vitest with coverage thresholds and CI-specific browser testing settings
  • Set up base path configuration for GitHub Pages deployment in Vite and Storybook configs
  • Added mise.toml for Bun version management and new test:coverage npm script

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
vitest.config.ts Added coverage configuration with thresholds, CI environment detection, and Playwright browser settings optimized for CI
vite.config.ts Added CI-aware base path configuration for GitHub Pages deployment
.storybook/main.ts Added viteFinal hook to configure base path for Storybook in CI/production builds
.github/workflows/test.yml New workflow for running tests, linting, type checking, and uploading coverage reports
.github/workflows/storybook-deploy.yml New workflow for building and deploying both the app and Storybook to GitHub Pages
package.json Added test:coverage script for generating coverage reports
mise.toml New file specifying Bun version 1.1.38 for consistent tooling
README.md Updated with Live section and comprehensive CI/CD documentation
src/reatom.init.ts Added comment emphasizing importance of clearStack() call

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

Comment thread vite.config.ts Outdated
Comment thread .github/workflows/storybook-deploy.yml
Comment thread .github/workflows/storybook-deploy.yml Outdated
Comment thread .github/workflows/storybook-deploy.yml Outdated
Comment thread .github/workflows/test.yml Outdated
@Guria
Copy link
Copy Markdown
Owner Author

Guria commented Jan 25, 2026

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 25, 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.

Copy link
Copy Markdown

@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: 1

🤖 Fix all issues with AI agents
In `@README.md`:
- Around line 43-46: In the "Live" section of README.md (the "## Live" heading
and its list items), replace the bare URLs that trigger MD034 with explicit
Markdown link syntax; e.g. change the plain URL list items for the App and
Storybook to use link text like [App](https://guria.github.io/modern-stack/) and
[Storybook](https://guria.github.io/modern-stack/storybook/) so the URLs are not
bare.
♻️ Duplicate comments (4)
.github/workflows/test.yml (1)

67-75: Use a JSON-aware transform for the coverage summary.

Line 74’s sed can corrupt JSON; this was already flagged in a prior review.

✅ Suggested fix
-            sed "s|$PWD/||g" coverage/coverage-summary.json >> $GITHUB_STEP_SUMMARY
+            jq --arg cwd "$PWD/" 'walk(if type == "string" then gsub($cwd; "") else . end)' \
+              coverage/coverage-summary.json >> "$GITHUB_STEP_SUMMARY"
.github/workflows/storybook-deploy.yml (2)

34-41: Set CI environment variable explicitly for build steps.

The build steps rely on CI === 'true' checks in vite.config.ts and .storybook/main.ts for base path configuration. While GitHub Actions sets CI=true by default, explicitly defining it improves clarity and self-documentation.

Suggested fix
       - name: Build app
+        env:
+          CI: 'true'
         run: bun run build

       - name: Verify app build
         run: test -f dist/index.html || exit 1

       - name: Build Storybook
+        env:
+          CI: 'true'
         run: bun run build-storybook

Alternatively, set it at the job level:

   build:
     runs-on: ubuntu-latest
     timeout-minutes: 10
+    env:
+      CI: 'true'
     permissions:
       contents: read

23-26: Consider using mise-action for Bun version consistency.

The test.yml workflow uses mise-action which reads the Bun version from mise.toml, while this workflow hardcodes bun-version: 1.1.38. Using a single source of truth reduces maintenance burden.

vite.config.ts (1)

4-4: Standardize variable naming: isCiisCI.

This file uses isCi while vitest.config.ts uses isCI. JavaScript conventions typically capitalize acronyms in camelCase identifiers.

Suggested fix
-const isCi = process.env['CI'] === 'true'
+const isCI = process.env['CI'] === 'true'

And update the reference on line 8:

-	base: command === 'build' && isCi ? '/modern-stack/' : '/',
+	base: command === 'build' && isCI ? '/modern-stack/' : '/',
🧹 Nitpick comments (1)
vitest.config.ts (1)

45-46: Consider documenting the timeout rationale.

The 6x timeout increase (10s → 60s) for CI is significant. While reasonable for containerized browser tests, a brief comment explaining why CI needs longer timeouts would help future maintainers.

Suggested improvement
 				test: {
 					name: 'storybook',
+					// CI environments are slower due to containerization and shared resources
 					testTimeout: isCI ? 60000 : 10000,
 					hookTimeout: isCI ? 60000 : 10000,

Comment thread README.md
Comment on lines +43 to +46
## Live

- App: https://guria.github.io/modern-stack/
- Storybook: https://guria.github.io/modern-stack/storybook/
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Convert bare URLs to Markdown links.

Line 45–46 trips MD034 and is easy to fix with link syntax.

✅ Suggested fix
- - App: https://guria.github.io/modern-stack/
- - Storybook: https://guria.github.io/modern-stack/storybook/
+ - App: [https://guria.github.io/modern-stack/](https://guria.github.io/modern-stack/)
+ - Storybook: [https://guria.github.io/modern-stack/storybook/](https://guria.github.io/modern-stack/storybook/)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
## Live
- App: https://guria.github.io/modern-stack/
- Storybook: https://guria.github.io/modern-stack/storybook/
## Live
- App: [https://guria.github.io/modern-stack/](https://guria.github.io/modern-stack/)
- Storybook: [https://guria.github.io/modern-stack/storybook/](https://guria.github.io/modern-stack/storybook/)
🧰 Tools
🪛 markdownlint-cli2 (0.18.1)

45-45: Bare URL used

(MD034, no-bare-urls)


46-46: Bare URL used

(MD034, no-bare-urls)

🤖 Prompt for AI Agents
In `@README.md` around lines 43 - 46, In the "Live" section of README.md (the "##
Live" heading and its list items), replace the bare URLs that trigger MD034 with
explicit Markdown link syntax; e.g. change the plain URL list items for the App
and Storybook to use link text like [App](https://guria.github.io/modern-stack/)
and [Storybook](https://guria.github.io/modern-stack/storybook/) so the URLs are
not bare.

@Guria Guria merged commit ae182b5 into main Jan 25, 2026
2 checks passed
@Guria Guria deleted the github-actions branch January 25, 2026 02:26
This was referenced Jan 25, 2026
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