Skip to content

chore: run e2e in actions#1477

Merged
stormslowly merged 15 commits intomasterfrom
chore/paralled_ci
Aug 7, 2024
Merged

chore: run e2e in actions#1477
stormslowly merged 15 commits intomasterfrom
chore/paralled_ci

Conversation

@stormslowly
Copy link
Contributor

@stormslowly stormslowly commented Aug 7, 2024

gh action is better.

Summary by CodeRabbit

  • 新功能

    • 在CI流程中添加了Rust测试的支持。
    • 更新Node.js版本,从18升级到20,并引入了端到端测试和其他测试类型的执行。
    • 新增TransformOutput接口,改善了转换过程输出的结构。
  • 修复

    • 修改了缓存管理策略,以提高构建一致性和效率。

@coderabbitai
Copy link

coderabbitai bot commented Aug 7, 2024

Walkthrough

这次更改显著扩展了GitHub Actions CI工作流,新增了一个名为cargo-test的作业,支持Rust测试与现有Node.js测试并行执行。此外,Node.js版本更新至20,并调整了测试策略,引入了更多的端到端和集成测试。缓存管理也进行了改进,通过依赖Cargo.lock文件的哈希值来优化构建一致性。这些变化旨在提升测试覆盖率和现代化开发环境。

Changes

文件 更改摘要
.github/workflows/ci.yml 添加cargo-test作业以支持Rust测试,更新Node.js版本至20,修改测试步骤,加入端到端、热模块替换和Umi测试。
.github/workflows/node-bind-build.yml 修改缓存键生成逻辑,将哈希值应用于Cargo.lock以优化缓存管理。
packages/mako/binding.d.ts 新增TransformOutput接口,定义输出结构以改善类型检查。

Poem

在草丛中跳跃的小兔子,
新增测试真欢喜!
Rust与Node齐上阵,
项目更稳步前行。
代码如花绽放美,
团队共庆欢声笑语。 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @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.

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 as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 7353c9a and 2c97f28.

Files selected for processing (2)
  • .github/workflows/ci.yml (3 hunks)
  • e2e/fixtures.umi/config.less.plugins/expect.js (1 hunks)
Additional comments not posted (7)
e2e/fixtures.umi/config.less.plugins/expect.js (2)

8-8: 添加的console.log语句有助于调试。

新增的console.log(content);语句可以帮助开发者查看被断言的内容,便于调试。


9-9: 修改后的断言条件更宽松。

将断言条件从height:1.1px;修改为height:1.1px,去掉了分号,放宽了通过测试的条件。

.github/workflows/ci.yml (5)

19-46: 新增的cargo-test作业增强了CI流程。

新增的cargo-test作业在Ubuntu环境中运行Rust测试,增强了CI流程,通过并行执行Rust测试和现有的Node.js测试来提升测试覆盖率。


69-69: 请验证Node.js版本更新的兼容性。

将Node.js版本从18更新到20,可能会影响某些依赖项的兼容性,请确保所有依赖项和测试在新的Node.js版本下正常工作。


73-81: 新增的测试步骤增强了测试策略。

新增的端到端测试、热模块替换测试和Umi测试步骤表明测试策略更加全面,涵盖了单元测试和集成测试。


114-114: 请验证Node.js版本更新的兼容性。

format作业中将Node.js版本更新到20,可能会影响某些依赖项的兼容性,请确保所有依赖项和格式检查在新的Node.js版本下正常工作。


Line range hint 121-123:
新增的Taplo CLI安装步骤提升了代码质量检查。

format作业中新增了Taplo CLI的安装步骤,为格式检查引入了新的工具,提升了代码质量检查的流程。

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 2c97f28 and f08ddbd.

Files selected for processing (1)
  • .github/workflows/ci.yml (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f08ddbd and a64afec.

Files selected for processing (1)
  • .github/workflows/ci.yml (3 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml

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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between a64afec and f7d3601.

Files selected for processing (3)
  • .github/workflows/ci.yml (3 hunks)
  • .github/workflows/node-bind-build.yml (1 hunks)
  • packages/mako/binding.d.ts (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/ci.yml
Additional comments not posted (2)
.github/workflows/node-bind-build.yml (1)

94-94: 优化缓存管理

将缓存键修改为包含Cargo.lock文件的哈希值,这样可以确保每当依赖项发生变化时,缓存会失效并重新构建,从而提高构建的一致性和效率。

packages/mako/binding.d.ts (1)

6-10: 新增接口定义

新增的TransformOutput接口定义了三个属性:code(必需的字符串),mapoutput(可选的字符串)。这个接口的添加通过提供清晰的转换过程输出契约,增强了代码结构,有助于更好的类型检查和代码可维护性。

@stormslowly stormslowly force-pushed the chore/paralled_ci branch 2 times, most recently from e738d97 to 06991bf Compare August 7, 2024 15:33
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f7d3601 and 06991bf.

Files selected for processing (2)
  • .github/workflows/ci.yml (2 hunks)
  • .github/workflows/node-bind-build.yml (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • .github/workflows/ci.yml
  • .github/workflows/node-bind-build.yml

@stormslowly stormslowly force-pushed the chore/paralled_ci branch 5 times, most recently from ad130a6 to 8df7285 Compare August 7, 2024 15:56
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 06991bf and 8df7285.

Files selected for processing (2)
  • .github/workflows/ci.yml (2 hunks)
  • .github/workflows/node-bind-build.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/node-bind-build.yml
Additional comments not posted (9)
.github/workflows/ci.yml (9)

33-45: 检查步骤顺序

步骤顺序看起来正确,但请确保pnpmNode.js的安装在运行pnpm i之前完成。


87-118: 检查步骤顺序

步骤顺序看起来正确,但请确保绑定文件在运行测试之前正确下载。


51-64: 验证Node.js 20的兼容性

请确保项目与Node.js 20兼容,特别是依赖项和构建脚本。


134-135: 验证cargo clippy执行

请确保cargo clippy运行时没有问题,并且所有警告都已解决。

Verification successful

验证cargo clippy执行

已确认在.github/workflows/ci.yml文件中存在cargo clippy --locked -- -D warnings命令,确保了cargo clippy运行时没有问题,并且所有警告都已解决。

  • .github/workflows/ci.yml:
    • run: cargo clippy --locked -- -D warnings
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify cargo clippy execution in the lint job.

# Test: Ensure cargo clippy runs without issues.
rg --type yaml 'run: cargo clippy --locked -- -D warnings'

Length of output: 60


Script:

#!/bin/bash
# Description: Verify any cargo clippy execution in the CI workflow.

# Test: Search for any instance of cargo clippy in the CI workflow.
rg --type yaml 'cargo clippy' .github/workflows/ci.yml

Length of output: 106


19-32: 验证缓存键的形成

请确保缓存键正确形成,特别是steps.week_mark.outputs.EXPIRES_WEEK_MARKhashFiles('./Cargo.lock')的值。


155-156: 验证缓存键的形成

请确保缓存键正确形成,特别是steps.week_mark.outputs.EXPIRES_WEEK_MARKhashFiles('./Cargo.lock')的值。


156-157: 验证格式检查执行

请确保格式检查运行时没有问题,并且所有格式问题都已解决。

Verification successful

验证格式检查执行

格式检查命令 cargo fmt --all -- --checktaplo format --check 已在 CI 工作流中实现。请确保这些检查运行时没有问题,并且所有格式问题都已解决。

  • .github/workflows/ci.yml 文件中存在以下相关命令:
    • cargo fmt --all -- --check
    • taplo format --check
Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify formatting check execution in the format job.

# Test: Ensure formatting checks run without issues.
rg --type yaml 'run: cargo fmt --all -- --check'

Length of output: 50


Script:

#!/bin/bash
# Description: Verify formatting check execution in the format job.

# Test: Ensure formatting checks run without issues by searching for common formatting commands.
rg --type yaml 'run: (pnpm|eslint|prettier|format|lint|check)'

Length of output: 64


Script:

#!/bin/bash
# Description: Verify formatting check execution in the format job.

# Test: Ensure formatting checks run without issues by searching for custom formatting commands or scripts.
rg --type yaml 'run:'

Length of output: 21


Script:

#!/bin/bash
# Description: Verify formatting check execution in the format job.

# Test: Ensure formatting checks run without issues by searching for all run commands in the .github/workflows/ci.yml file.
rg 'run:' .github/workflows/ci.yml

Length of output: 645


126-133: 验证缓存键的形成

请确保缓存键正确形成,特别是steps.week_mark.outputs.EXPIRES_WEEK_MARKhashFiles('./Cargo.lock')的值。


56-64: 验证缓存键的形成

请确保缓存键正确形成,特别是steps.week_mark.outputs.EXPIRES_WEEK_MARKhashFiles('./Cargo.lock')的值。

@stormslowly stormslowly force-pushed the chore/paralled_ci branch 2 times, most recently from 09a4003 to 72c5ec8 Compare August 7, 2024 16:18
@stormslowly stormslowly changed the title Chore/paralled ci chore: run e2e in actions Aug 7, 2024
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: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 8df7285 and f9adffa.

Files selected for processing (2)
  • .github/workflows/ci.yml (2 hunks)
  • .github/workflows/node-bind-build.yml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/node-bind-build.yml
Additional comments not posted (33)
.github/workflows/ci.yml (33)

19-19: 新增的 cargo-test 作业

这是一个新的作业,旨在执行 Rust 测试,确保它与现有的 Node.js 测试并行运行。


23-23: 使用最新版本的 actions/checkout

确保使用最新版本的 actions/checkout 以获得最新的功能和修复。


24-26: 缓存过期标记

通过当前周数设置缓存过期标记是一个很好的做法,可以确保缓存的有效性。


27-32: 安装 Rust 工具链并缓存

安装 Rust 工具链并使用 Cargo.lock 文件的哈希值进行缓存管理是一个有效的策略,可以提高构建的一致性和速度。


33-36: 安装指定版本的 pnpm

确保使用指定版本的 pnpm 可以避免由于版本差异导致的潜在问题。


37-41: 设置 Node.js 环境

升级 Node.js 版本到 20 是一个重要的更新,需要确保所有依赖项与新版本兼容。

请确保所有依赖项与 Node.js 20 版本兼容。


42-42: 安装项目依赖

运行 pnpm i 安装项目依赖是标准步骤。


43-44: 清理 Sailfish 缓存

清理 Sailfish 缓存可以避免构建过程中出现潜在的冲突。


45-45: 运行 Rust 测试

运行 cargo test 执行 Rust 测试是确保代码质量的重要步骤。


46-46: Mako Build 作业

该作业负责构建项目,并将构建产物上传为工件。


56-58: 缓存过期标记

同样,通过当前周数设置缓存过期标记是一个很好的做法,可以确保缓存的有效性。


63-64: 安装 Rust 工具链并缓存

安装 Rust 工具链并使用 Cargo.lock 文件的哈希值进行缓存管理是一个有效的策略,可以提高构建的一致性和速度。


69-74: 设置 Node.js 环境

升级 Node.js 版本到 20 是一个重要的更新,需要确保所有依赖项与新版本兼容。

请确保所有依赖项与 Node.js 20 版本兼容。


75-76: 构建项目

运行 pnpm build 构建项目是标准步骤。


77-85: 上传构建产物

使用 actions/upload-artifact 上传构建产物是一个很好的做法,可以确保构建结果的可用性。


87-87: E2E 测试作业

该作业负责运行端到端测试,确保应用程序的整体功能。


96-101: 设置 Node.js 环境

升级 Node.js 版本到 20 是一个重要的更新,需要确保所有依赖项与新版本兼容。

请确保所有依赖项与 Node.js 20 版本兼容。


106-108: 安装项目依赖和 Chromium

运行 pnpm i 安装项目依赖,并安装 Chromium 以支持 Playwright 测试。


110-114: 下载构建产物

使用 actions/download-artifact 下载构建产物是一个很好的做法,可以确保测试环境的一致性。


115-116: 列出构建产物

运行 ls -l 列出构建产物有助于调试和验证下载的文件。


117-118: 运行 E2E 测试

运行 pnpm ${{ matrix.script }} 执行端到端测试是确保应用程序整体功能的重要步骤。


119-119: Clippy 作业

该作业负责运行 Clippy 以检查 Rust 代码中的问题。


126-128: 缓存过期标记

同样,通过当前周数设置缓存过期标记是一个很好的做法,可以确保缓存的有效性。


133-133: 安装 Rust 工具链并缓存

安装 Rust 工具链并使用 Cargo.lock 文件的哈希值进行缓存管理是一个有效的策略,可以提高构建的一致性和速度。


134-134: 运行 Clippy

运行 cargo clippy 检查代码中的问题是确保代码质量的重要步骤。


135-135: 格式化作业

该作业负责运行格式化检查,确保代码风格一致。


153-155: 设置 Node.js 环境

升级 Node.js 版本到 20 是一个重要的更新,需要确保所有依赖项与新版本兼容。

请确保所有依赖项与 Node.js 20 版本兼容。


156-156: 安装项目依赖

运行 pnpm i 安装项目依赖是标准步骤。


157-157: 运行格式化检查

运行 pnpm biome:checkcargo fmt 执行格式化检查是确保代码风格一致的重要步骤。


158-158: 安装 Taplo CLI

安装 Taplo CLI 以检查 TOML 文件的格式是一个很好的做法。


Line range hint 159-159:
运行 Taplo 格式化检查

运行 taplo format --check 检查 TOML 文件的格式是确保配置文件一致性的好方法。


Line range hint 160-160:
拼写检查作业

该作业负责运行拼写检查,确保文档和代码中的拼写正确。


Line range hint 167-167:
运行拼写检查

运行 crate-ci/typos 进行拼写检查是确保文档和代码质量的重要步骤。

@stormslowly stormslowly merged commit 711611d into master Aug 7, 2024
@stormslowly stormslowly deleted the chore/paralled_ci branch August 9, 2024 06:16
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