Skip to content

Commit

Permalink
Merge pull request #2 from CrazyHZM/feat/add_ci
Browse files Browse the repository at this point in the history
feat: Add github action
  • Loading branch information
zhenjunMa authored Nov 11, 2024
2 parents 2bc5001 + 0e020d7 commit 655267c
Show file tree
Hide file tree
Showing 22 changed files with 891 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/ask-question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Ask Question
about: Ask a question about usage or features
---

### Your question

Describe your question clearly.

### Environment

- Layotto Version
- Layotto Go Version

### Logs

- Paste the logs you see.
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: Bug Report
about: Report a bug
labels: kind/bug

---

<!-- Please use this template while reporting a bug and provide as much info as possible. Not doing so may result in your bug not being addressed in a timely manner. Thanks!
-->


**What happened**:

**What you expected to happen**:

**How to reproduce it (as minimally and precisely as possible)**:

**Anything else we need to know?**:
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Enhancement Request
about: Suggest an enhancement
labels: kind/feature

---
<!-- Please only use this template for submitting enhancement requests -->

**What would you like to be added**:

**Why is this needed**:
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/good-first-issue-translate-into-chinese.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: "Good first issue (translate a doc into chinese)"
about: Submit a good first issue
labels: ["kind/documentation", "help wanted","good first issue","easy" ]
title: "Translate XXX doc into chinese; 把 XXX 文档翻译成中文"

---
<!-- Please only use this template for submitting good first issues -->

**What would you like to be added**:

Translate the **(FIXME) XXX** doc into chinese.

Url: **(FIXME)**

chinese:
将英文文档翻译成中文,地址见上。


**Why is this needed**:
More user-friendly.
21 changes: 21 additions & 0 deletions .github/ISSUE_TEMPLATE/good-first-issue-translate-into-english.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: "Good first issue (translate a doc into english)"
about: Submit a good first issue
labels: ["kind/documentation", "help wanted","good first issue","easy" ]
title: "Translate XXX doc into english; 把 XXX 文档翻译成英文"

---
<!-- Please only use this template for submitting good first issues -->

**What would you like to be added**:

Translate the **(FIXME) XXX** doc into english.

Url: **(FIXME)**

chinese:
将中文文档翻译成英文,地址见上。


**Why is this needed**:
More user-friendly.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/good-first-issue-ut.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: "Good first issue (add unit test)"
about: Submit a good first issue
labels: ["kind/test", "help wanted","good first issue","easy" ]
title: "Add unit test for XXX; 为 XXX 相关代码添加单元测试"

---
<!-- Please only use this template for submitting enhancement requests -->

**What would you like to be added**:
Add unit tests for XXX related code.

The code path is: **(FIXME)**

Reference doc of this module: **(FIXME)**

The unit test coverage of this module should reach 60%.

If you encounter any problems, you can ask for help by leaving a message under this issue.

**What can you learn from fixing this issue**:
By doing this improvement,you will learn that how Layotto implement the XXX feature.

**Why is this needed**:
Currently the test coverage of XXX is low.
25 changes: 25 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!-- Thanks for sending a pull request!
Read contributing.md before commit pull request.
-->

**What this PR does**:

**Which issue(s) this PR fixes**:
<!--
*Automatically closes linked issue when PR is merged.
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
_If PR is about `failing-tests or flakes`, please post the related issues/tests in a comment and do not use `Fixes`_*
-->
Fixes #

**Special notes for your reviewer**:

**Does this PR introduce a user-facing change?**:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
```
66 changes: 66 additions & 0 deletions .github/dead_link_check_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"ignorePatterns": [
{
"pattern": "^http://localhost"
},
{
"pattern": "^http://127.0.0.1"
},
{
"pattern": "^https://segmentfault.com/"
},
{
"pattern": "^https://console.cloud.tencent.com/cos/bucket"
},
{
"pattern": "^https://docs.buf.build/"
},
{
"pattern":"^https://techhenzy.com/"
},
{
"pattern":"^https://www.soft.tech/blog/"
},
{
"pattern":"^https://www.sofastack.tech/blog/the-next-five-years-of-cloud-native-runtime/"
},
{
"pattern":"^https://github.com/mosn/layotto/blob/f70cdc6196963ad762cf809daf0579403c341def1/spec/proto/runtime/v1/runtime.proto"
},
{
"pattern": "^#"
}
],
"replacementPatterns": [
{
"pattern": "^/docs",
"replacement": "/github/workspace/docs/docs"
},
{
"pattern": "^/img",
"replacement": "/github/workspace/docs/static/img"
},
{
"pattern": "^start/",
"replacement": "/github/workspace/docs/i18n/en-US/docusaurus-plugin-content-docs/current/start/"
},
{
"pattern": "^community/",
"replacement": "/github/workspace/docs/i18n/en-US/docusaurus-plugin-content-docs/current/community/"
},
{
"pattern": "^component_specs/",
"replacement": "/github/workspace/docs/i18n/en-US/docusaurus-plugin-content-docs/current/component_specs/"
},


],
"timeout": "10s",
"retryOn429": true,
"retryCount": 2,
"fallbackRetryDelay": "10s",
"aliveStatusCodes": [
200,
401
]
}
52 changes: 52 additions & 0 deletions .github/markdown_lint_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"MD001": true,
"MD002": false,
"MD003": false,
"MD004": false,
"MD005": false,
"MD006": false,
"MD007": false,
"MD008": false,
"MD009": false,
"MD010": false,
"MD011": false,
"MD012": false,
"MD013": false,
"MD014": false,
"MD015": false,
"MD016": false,
"MD017": false,
"MD018": false,
"MD019": false,
"MD020": false,
"MD021": false,
"MD022": false,
"MD023": false,
"MD024": false,
"MD025": false,
"MD026": false,
"MD027": false,
"MD028": false,
"MD029": false,
"MD030": false,
"MD031": true,
"MD032": false,
"MD033": false,
"MD034": false,
"MD035": false,
"MD036": false,
"MD037": true,
"MD038": true,
"MD039": false,
"MD040": false,
"MD041": false,
"MD042": false,
"MD043": false,
"MD044": false,
"MD045": false,
"MD046": false,
"MD047": false,
"MD048": false,
"MD049": false,
"MD050": false
}
24 changes: 24 additions & 0 deletions .github/workflows/cloud_code_scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Alipay Cloud Devops Codescan
on:
pull_request_target:
jobs:
stc: #安全扫描
runs-on: ubuntu-latest
steps:
- name: codeScan
uses: layotto/alipay-cloud-devops-codescan@main
with:
parent_uid: ${{ secrets.ALI_PID }}
private_key: ${{ secrets.ALI_PK }}
scan_type: stc
tips: '可以加入钉钉群:31912621 来申请查看权限'
sca: # 开源合规
runs-on: ubuntu-latest
steps:
- name: codeScan
uses: layotto/alipay-cloud-devops-codescan@main
with:
parent_uid: ${{ secrets.ALI_PID }}
private_key: ${{ secrets.ALI_PK }}
scan_type: sca
tips: '可以加入钉钉群:31912621 来申请查看权限'
49 changes: 49 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Layotto Go SDK Env Pipeline 🌊

on:
schedule:
- cron: '0 4 * * 5'

jobs:
analyse:
name: CodeQL
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
# Override language selection by uncommenting this and choosing your languages
# with:
# languages: go, javascript, csharp, python, cpp, java

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
43 changes: 43 additions & 0 deletions .github/workflows/dead-link-checker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Layotto Go SDK Env Pipeline 🌊

# Deadlink Validation will auto run at 0:00 am everyday.
on:
schedule:
- cron: '0 0 * * *'
pull_request:
paths:
- '**/*.md'
types: [opened, edited, reopened, synchronize]
branches:
- main

jobs:
check:
name: "DeadLink Validation"
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Check out code
uses: actions/checkout@v2
# - name: Install and start docusaurus server
# run: |
# sudo npm install
# sudo npm run build --config docs && nohup npm run serve --config docs &
- uses: gaurav-nelson/github-action-markdown-link-check@v1
with:
base-branch: main
use-quiet-mode: 'yes'
use-verbose-mode: 'yes'
check-modified-files-only: 'yes'
config-file: '.github/dead_link_check_config.json'
folder-path: 'docs/blog/,docs/docs/,docs/i18n/en-US/docusaurus-plugin-content-blog/,docs/i18n/en-US/docusaurus-plugin-content-docs/current/'

# - name: Install markdown-link-check
# run: sudo npm install -g markdown-link-check

# - name: Install and start docusaurus server
# run: |
# sudo npm install
# sudo npm run build --config docs && npm run serve --config docs
# - name: Check dead links in all the .md files
# run: make deadlink
Loading

0 comments on commit 655267c

Please sign in to comment.