Skip to content

Optimize/workflow add cache#669

Merged
zds-s merged 16 commits into
mineadmin:masterfrom
people-sea:optimize/workflow-add-cache
Jul 26, 2025
Merged

Optimize/workflow add cache#669
zds-s merged 16 commits into
mineadmin:masterfrom
people-sea:optimize/workflow-add-cache

Conversation

@people-sea

@people-sea people-sea commented Jul 26, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • 杂项
    • 更新了持续集成流程,提升了 PHP 版本至 8.3,并优化了 Swoole/Swow 相关扩展的配置与管理。
    • 引入统一的 PHP 扩展环境变量,简化扩展安装流程。
    • 改进 Composer 和 APT 包的缓存策略,加快依赖安装速度。
    • 优化了工作流触发条件和步骤顺序,提升了 CI 的一致性与维护性。

@people-sea
people-sea requested a review from zds-s July 26, 2025 18:04
@boring-cyborg boring-cyborg Bot added the GitHub label Jul 26, 2025
@coderabbitai

coderabbitai Bot commented Jul 26, 2025

Copy link
Copy Markdown

Warning

Rate limit exceeded

@dosubot[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 40 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 2b5a361 and 776a9c2.

📒 Files selected for processing (1)
  • .github/workflows/test.yml (7 hunks)
📝 Walkthrough

"""

Walkthrough

本次变更主要针对 GitHub Actions 的 CI 工作流配置文件,更新了 PHP 版本矩阵至 8.3,统一和优化了 PHP 扩展、Swoole/Swow 版本的环境变量管理,增强了 Composer 和 APT 包的缓存策略,并移除了部分冗余的系统升级步骤。

Changes

文件/分组 变更摘要
.github/workflows/code-coverage.yml 限定触发路径,PHP 版本矩阵升级,Swoole 版本动态化,优化扩展管理,移除系统升级,增强 Composer 缓存,简化 Swoole 安装步骤。
.github/workflows/test.yml PHP 版本矩阵升级,Swoole 版本矩阵重命名,统一 PHP 扩展变量,增强 Composer/apt 缓存,移除系统升级,优化 Swow/Swoole 测试流程。

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant Runner
    participant Composer
    participant PHP
    participant Swoole/Swow

    GitHub Actions->>Runner: 触发 workflow(push/pull_request 并限定路径)
    Runner->>PHP: 安装指定 PHP 版本和扩展(使用 PHP_EXTENSIONS)
    Runner->>Composer: 恢复 composer 缓存
    Runner->>Runner: 安装 apt 依赖(带缓存)
    Runner->>Swoole/Swow: 安装/配置 Swoole 或 Swow 扩展
    Runner->>Composer: 安装 PHP 依赖
    Runner->>Runner: 执行测试/代码检查
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested labels

size:XS, lgtm

Suggested reviewers

  • zds-s

Poem

🐰
Actions 跳跃云端间,
PHP 版本焕新颜。
Composer 缓存藏珍宝,
Swoole Swow 轻装前。
测试流程更流畅,
代码如风舞蓝天!

"""

✨ Finishing Touches
🧪 Generate unit tests
  • 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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or PR title anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@people-sea
people-sea marked this pull request as ready for review July 26, 2025 18:04
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement labels Jul 26, 2025

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2ff8c5f and 6f74e4e.

📒 Files selected for processing (2)
  • .github/workflows/code-coverage.yml (3 hunks)
  • .github/workflows/test.yml (8 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
  • GitHub Check: Test on PHP8.1 Swoole-master
  • GitHub Check: Test on PHP8.1 Swoole-v6.0.2
  • GitHub Check: Test on PHP8.1 Swoole-v5.1.6
  • GitHub Check: Test on PHP8.1 Swoole-v5.0.3
  • GitHub Check: Test on PHP8.2 Swoole-v6.0.2
  • GitHub Check: Test on PHP8.2 Swoole-v5.1.6
  • GitHub Check: Test on PHP8.2 Swoole-master
  • GitHub Check: Test on PHP8.3 Swoole-master
  • GitHub Check: Test on PHP8.2 Swoole-v5.0.3
  • GitHub Check: Test on PHP8.3 Swoole-v6.0.2
  • GitHub Check: Test on PHP8.3 Swoole-v5.1.6
  • GitHub Check: Test on PHP8.1 Swow-develop
  • GitHub Check: Test on PHP8.2 Swow-develop
  • GitHub Check: Test on PHP8.3 Swow-develop
🔇 Additional comments (6)
.github/workflows/test.yml (4)

33-34: CS Fix 任务可能不需要编译 Swoole

PHP_EXTENSIONS 中包含 swoole-${{ matrix.sw-version }},但 CS Fix 仅做代码格式检查,无需加载/编译 Swoole。
去掉该扩展可显著缩短执行时间、降低出错率。

[ suggest_optional_refactor ]


64-69: 矩阵排除组合可能遗漏

已排除 php-version: '8.3'sw-version: 'v5.0.3',但仍允许 8.2/8.1 配合 v5.0.3。
若 v5.0.3 与高版本 PHP 均不兼容,应一并排除;否则可能导致无谓失败。


95-99: APT 包缓存步骤 👍

引入 cache-apt-pkgs-action 能大量节省下载时间,实践良好。


165-167: 无效的排除规则

tests-swowexclude 声明了 sw-version: 'v5.0.3',但矩阵仅含 'develop'
该规则不会生效,建议删除以免迷惑。

[ suggest_nitpick ]

.github/workflows/code-coverage.yml (2)

55-59: 重复设置 swoole.use_shortname,步骤冗余

Set Swoole ShortnameSetup Swoole 都执行了相同的 echo swoole.use_shortname='Off',造成重复。
合并成一次即可减少步骤并加快流水线。

[ suggest_optional_refactor ]

Also applies to: 70-72


60-68: Composer 缓存键设计合理

键中加入 php-versionsw-versioncomposer.lock 哈希,可有效避免误命中,👍

Comment thread .github/workflows/test.yml
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 26, 2025
@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jul 26, 2025
@zds-s
zds-s merged commit 417648e into mineadmin:master Jul 26, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement GitHub lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants