You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2023/05/08 07:26:39 UTC
[shardingsphere] branch master updated: Add action doc (#25511)
This is an automated email from the ASF dual-hosted git repository.
zhangliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 9586286c45b Add action doc (#25511)
9586286c45b is described below
commit 9586286c45b177231362a94583c6a8cd40648b0a
Author: 孙念君 Nianjun Sun <su...@apache.org>
AuthorDate: Mon May 8 15:26:31 2023 +0800
Add action doc (#25511)
* Document : refactor a description for GitHub Action conduct
---------
Co-authored-by: shardingsphere <de...@shardingsphere.apache.org>
---
docs/community/content/involved/conduct/code.cn.md | 13 ++++++++++++-
docs/community/content/involved/conduct/code.en.md | 15 +++++++++++++--
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/docs/community/content/involved/conduct/code.cn.md b/docs/community/content/involved/conduct/code.cn.md
index be40837813a..79590bb5e46 100644
--- a/docs/community/content/involved/conduct/code.cn.md
+++ b/docs/community/content/involved/conduct/code.cn.md
@@ -93,7 +93,7 @@ chapter = true
- 模拟静态方法或构造器,应优先考虑使用测试框架提供的 `AutoMockExtension` 和 `StaticMockSettings` 自动释放资源;若使用 Mockito `mockStatic` 和 `mockConstruction` 方法,必须搭配 `try-with-resource` 或在清理方法中关闭,避免泄漏。
- 校验仅有一次调用时,无需使用 `times(1)` 参数,使用 `verify` 的单参数方法即可。
-## G4 编码规范
+## G4 规范
- 公共规范
- 每行长度不超过 `200` 个字符,保证每一行语义完整以便于理解。
@@ -108,3 +108,14 @@ chapter = true
- 如果一个规则的分支超过 `5` 个,则每个分支一行。
- 规则命名采用 java 变量的驼峰形式。
- 为每种 SQL 语句类型定义一个独立的语法文件,文件名称由 `数据库名称` + `语句类型名称` + `Statement`。例如:`MySQLDQLStatement.g4`。
+
+## GitHub Action 规范
+
+- Workflow 文件名以 `.yml` 结尾。
+- Workflow 文件名由 `触发方式-执行操作` 的小写字母组成,例如 `nightly-check.yml`。pull_request 触发的任务省略触发方式,例如 `check.yml`。
+- 触发方式包括:pull_request(不加前缀)、nightly。
+- 执行操作包括: check、ci、e2e 、build。
+- Workflow 文件内的 `name` 属性命名与文件名一致,单词以 `-` 作为分隔符,分隔符两侧要加空格,每个单词首字母大写,例如 `Nightly - Check`。
+- Workflow 中的 `job` 属性命名,须在 Workflow 中保持唯一。
+- 使用 `matrix` 的时候,必须添加作业并行度限制为 5:`max-parallel: 5`。
+- 必须为作业设置超时时间,最大不超过 1 小时。例如 `timeout-minutes: 10`。
diff --git a/docs/community/content/involved/conduct/code.en.md b/docs/community/content/involved/conduct/code.en.md
index 6575df039a3..37814e3f651 100644
--- a/docs/community/content/involved/conduct/code.en.md
+++ b/docs/community/content/involved/conduct/code.en.md
@@ -93,7 +93,7 @@ The following code of conduct is based on full compliance with [ASF CODE OF COND
- When mocking static methods or constructors, it is recommended to use the testing framework's `AutoMockExtension` and `StaticMockSettings` to release resources automatically; If using Mockito's `mockStatic` and `mockConstruction` methods, please use `try-with-resource` or close them in the cleanup method to avoid resource leaks.
- When verifying only one invocation, there is no need to use `times(1)` parameter, please use the single-argument method of `verify`.
-## Contributor Covenant G4 Code of Conduct
+## Contributor Covenant G4 of Conduct
- Common Conduct
- Every line cannot over `200` chars, guarantee every line have complete semantics.
@@ -101,10 +101,21 @@ The following code of conduct is based on full compliance with [ASF CODE OF COND
- Every rule should be in single line, no empty line between rules.
- Rule of lexer name should capitalization. If name composite with more than one word, use `underline` to separate. Rule name of `DataType` and `Symbol` should end with `underline`. If rule name is conflicted with ANTLR's keyword, should take an `underline` behind rule name.
- For private rule in lexer should use `fragment`, rule with `fragment` should define behind of public rule which they served.
- - Common rule of lexer should put in file `Keyword.g4`, every database may has customized rule file by themselves. For example: `MySQLKeyword.g4`.
+ - Common rule of lexer should put in file `Keyword.g4`, every database may have customized rule file by themselves. For example: `MySQLKeyword.g4`.
- Parser Conduct
- After every rule finish, blank line should no indents.
- No space before rule name definition. One space between `colon` and rule, `semicolon` should take a new line and keep indents (including blank lines) consistent with the previous one.
- If a rule's branch is over than `5`, every branch take a new line.
- Rule name of parser should same with java variable's camel case.
- Define separate files for every SQL type, file name should consist of `database` + `SQL type` + `Statement`. For example: `MySQLDQLStatement.g4`.
+
+## GitHub Action of Conduct
+
+- Workflow file name must end with `.yml`.
+- Workflow file name must consist with the lowercase of `triggerType-actionType`, for example: `nightly-check.yml`. Omit trigger type for pull_request, for example: `check.yml`.
+- Trigger type includes: pull_request (without prefix), nightly.
+- Action type includes: check, ci, e2e, build.
+- `name` property in workflow file should be same with file name, Words separated by `-`, add space between `-` and words, first letter of every word should be capital, for example: `Nightly - Check`.
+- `job` property in workflow should be unique in that workflow file.
+- When using `matrix` property, must add job parallelism limit to 5: `max-parallel: 5`.
+- Must set timeout for job, max timeout is 1 hour. For example: `timeout-minutes: 10`.