Skip to content

feat: add unified CI and monorepo release workflow templates - #234

Merged
keito4 merged 1 commit into
mainfrom
feat/223-unified-ci-workflow
Dec 31, 2025
Merged

feat: add unified CI and monorepo release workflow templates#234
keito4 merged 1 commit into
mainfrom
feat/223-unified-ci-workflow

Conversation

@keito4

@keito4 keito4 commented Dec 31, 2025

Copy link
Copy Markdown
Owner

Summary

Add comprehensive GitHub Actions workflow templates for unified CI with coverage reporting and monorepo releases with intelligent change detection.

Changes

  • ✨ Add unified-ci.yml template with coverage reporting and PR size detection
  • ✨ Add monorepo-release.yml template with intelligent change detection
  • 📝 Create comprehensive README.md with customization guide
  • 📋 Include best practices and troubleshooting sections

Unified CI Workflow (#223)

Key Features

Quality Checks:

  • Fail-fast sequential execution (lint → type-check → build → test)
  • Frozen lockfile installation
  • Concurrency control to cancel outdated runs

Coverage Reporting:

  • Reads coverage-summary.json from test runs
  • Posts/updates PR comments with coverage tables
  • Supports multiple packages (monorepo-friendly)
  • Shows statements, branches, functions, lines coverage

PR Size Detection:

  • Automatically labels PRs: size/S, size/M, size/L, size/XL
  • Based on line changes and file count
  • Posts warning for XL PRs (>1000 lines or >30 files)
  • Removes old size labels automatically

PR Size Thresholds

Label Line Changes File Count
size/S < 100 < 10
size/M < 300 < 20
size/L < 1000 < 30
size/XL ≥ 1000 ≥ 30

Monorepo Release Workflow (#222)

Key Features

Change Detection:

  • Detects which packages have changed since last commit
  • Outputs flags for each package
  • Handles initial commits gracefully

Conditional Release:

  • Only releases packages that have actual changes
  • Runs tests before release
  • Separate semantic-release for each package

Production Configuration:

  • Concurrency control (no cancel for releases)
  • Proper permissions (contents, issues, PRs, packages)
  • GitHub Packages publishing support
  • Husky disabled in CI environment

Configuration

Each package needs .releaserc.json:

{
  "branches": ["main"],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    "@semantic-release/npm",
    "@semantic-release/github"
  ],
  "tagFormat": "package-name-v${version}"
}

Documentation

The README.md includes:

  • Usage instructions for both templates
  • Customization guide for different setups
  • Best practices for CI/CD workflows
  • Troubleshooting common issues

Benefits

Unified CI

  • 🚀 Improves developer experience with immediate coverage feedback
  • 📊 PR size labels help reviewers estimate effort
  • ✅ Comprehensive quality checks in single workflow
  • ⚡ Fast failure with sequential checks

Monorepo Release

  • 🎯 Efficient: Only releases changed packages
  • ✅ Reliable: Tests run before every release
  • 🔧 Flexible: Supports multiple package configurations
  • 📦 Production-proven: Used in monorepo projects

Fixes #223
Fixes #222

🤖 Generated with Claude Code

- Add unified-ci.yml with coverage reporting and PR size detection
- Add monorepo-release.yml with intelligent change detection
- Create comprehensive README with customization guide
- Include best practices and troubleshooting sections

Fixes #223
Fixes #222

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Dec 31, 2025

Copy link
Copy Markdown

Warning

Rate limit exceeded

@keito4 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 21 minutes and 22 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 11be2f2 and 472162e.

📒 Files selected for processing (3)
  • .github/workflows/templates/README.md
  • .github/workflows/templates/monorepo-release.yml
  • .github/workflows/templates/unified-ci.yml

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.


- name: Detect changes
id: changes
run: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2046:warning:2:6: Quote this to prevent word splitting [shellcheck]


- name: Detect changes
id: changes
run: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:11:27: Double quote to prevent globbing and word splitting [shellcheck]


- name: Detect changes
id: changes
run: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:12:37: Double quote to prevent globbing and word splitting [shellcheck]


- name: Detect changes
id: changes
run: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:14:38: Double quote to prevent globbing and word splitting [shellcheck]


- name: Detect changes
id: changes
run: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:18:27: Double quote to prevent globbing and word splitting [shellcheck]


- name: Detect changes
id: changes
run: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:28:36: Double quote to prevent globbing and word splitting [shellcheck]


- name: Detect changes
id: changes
run: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:4:35: Double quote to prevent globbing and word splitting [shellcheck]


- name: Detect changes
id: changes
run: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:5:35: Double quote to prevent globbing and word splitting [shellcheck]


- name: Detect changes
id: changes
run: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📝 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:6:33: Double quote to prevent globbing and word splitting [shellcheck]


- name: Detect changes
id: changes
run: |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚫 [actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2129:style:4:3: Consider using { cmd1; cmd2; } >> file instead of individual redirects [shellcheck]

@claude

claude Bot commented Dec 31, 2025

Copy link
Copy Markdown
Contributor

PR Review - GitHub Actions Workflow Templates

このPRについて、コード品質、ベストプラクティス、潜在的な問題、パフォーマンス、セキュリティ、テストカバレッジの観点からレビューを実施しました。

全体評価

優れた実装です。詳細なドキュメント、実用的なワークフローテンプレート、適切なエラーハンドリング、セキュリティ考慮が施されています。

詳細レビュー

1. コード品質: 5/5

優れている点:

  • 適切なジョブ依存関係(needs)の使用
  • 明確な条件分岐(if)
  • concurrency制御の実装

改善提案:

  1. 重複するテスト実行の削減 (unified-ci.yml:69, 91)

    • quality-checksとcoverage-reportで同じテストが2回実行されます
    • アーティファクトを使用してcoverageファイルを共有することでCI時間を短縮できます
  2. エラーハンドリングの追加 (unified-ci.yml:222-230)

    • XL PR警告コメントが重複投稿される可能性があります
    • 既存コメントの検索・更新ロジックを追加推奨

2. ベストプラクティス: 4/5

優れている点:

  • Conventional Commits準拠
  • fetch-depth: 0 でフルヒストリー取得
  • persist-credentials: false でセキュリティ強化
  • frozen-lockfile で再現性確保

改善提案:

  1. Node.jsバージョンの設定可能化
  2. タイムアウト設定の追加

3. 潜在的な問題とバグ

Issue 1: 変更検出ロジックの脆弱性 (monorepo-release.yml:64-86)

  • HEAD~1は直前のコミットのみを見るため、マージコミット対応が不十分
  • 推奨: 最後のリリースタグからの差分を検出するロジックへの変更

Issue 2: PRサイズ判定の論理エラー (unified-ci.yml:190-198)

  • AND条件を使用しているため、1000行変更でファイル数が5個の場合、期待と異なるラベルになります
  • 推奨: OR条件に変更

4. パフォーマンス

最適化提案:

  1. 並列実行の活用 - lint, type-check, buildは依存関係がなければ並列実行可能
  2. キャッシュ戦略の強化 - node_modulesだけでなく、ビルド成果物もキャッシュ推奨

5. セキュリティ

優れている点:

  • GITHUB_TOKENのみ使用(外部シークレット不要)
  • persist-credentials: false でクレデンシャル保護
  • 最小権限原則に従ったpermissions設定

改善提案:

  1. CODEOWNERS設定の推奨
  2. Dependabot設定でGitHub Actionsの自動更新

6. テストカバレッジ

推奨事項:

  1. 統合テスト環境の構築
  2. ドキュメント内にテスト手順を追加

優先度付き修正推奨

High Priority

  1. PRサイズ判定ロジックの修正 (論理エラー)
  2. 重複テスト実行の削減 (パフォーマンス)

Medium Priority

  1. 変更検出ロジックの改善 (マージコミット対応)
  2. XL PR警告の重複防止

Low Priority

  1. 並列実行の最適化
  2. タイムアウト設定の追加
  3. ドキュメント拡充

まとめ

総合評価: 8.5/10

このPRは非常に高品質な実装です。

優れている点:

  • 実用的で再利用可能なテンプレート
  • 詳細なドキュメントとカスタマイズガイド
  • セキュリティベストプラクティスの遵守
  • 適切なエラーハンドリング

改善推奨:

  • PRサイズ判定ロジックの修正(High Priority)
  • テスト実行の最適化

推奨アクション: High Priorityの2項目を修正後、マージ可能です。他の改善は将来的なイテレーションで対応可能です。

レビューは以上です。素晴らしい実装をありがとうございます!

@keito4
keito4 merged commit 9196e41 into main Dec 31, 2025
14 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.30.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@github-actions github-actions Bot added the released リリース済み label Dec 31, 2025
@keito4
keito4 deleted the feat/223-unified-ci-workflow branch January 29, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released リリース済み

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Add unified CI workflow with coverage reporting and PR size checks feat: Add monorepo release workflow with change detection

1 participant