generated from cloudwego/.github
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrating eino's devops ability (#1)
* feat: migrating eino's devops ability
- Loading branch information
1 parent
8638810
commit 97ad3cb
Showing
52 changed files
with
8,906 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,103 @@ | ||
name: Tests | ||
name: EinoExtTest | ||
|
||
on: [ push, pull_request ] | ||
on: [ pull_request ] | ||
|
||
jobs: | ||
unit-benchmark-test: | ||
unit_test: | ||
name: "eino ext unit test" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Go | ||
- name: "Set up Go" | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
|
||
- name: Unit Test | ||
run: go test -race -covermode=atomic -coverprofile=coverage.out ./... | ||
go-version: "1.18" | ||
- name: "GoTest" | ||
run: | | ||
modules=`find . -name "go.mod" -exec dirname {} \;` | ||
echo $modules | ||
list="" | ||
coverpkg="" | ||
if [[ ! -f "go.work" ]];then go work init;fi | ||
for module in $modules; do go work use $module; list=$module"/... "$list; coverpkg=$module"/...,"$coverpkg; done | ||
go work sync | ||
go test -race -coverprofile=coverage.out -gcflags="all=-l -N" -coverpkg=$coverpkg $list | ||
# Download main (aka base) branch breakdown | ||
- name: Download Artifact (main.breakdown) | ||
id: download-main-breakdown | ||
uses: dawidd6/action-download-artifact@v6 | ||
with: | ||
branch: main | ||
workflow_conclusion: success | ||
name: main.breakdown | ||
if_no_artifact_found: warn | ||
- name: Ensure default.breakdown exists if download fails | ||
run: | | ||
if [ ! -f main.breakdown ]; then | ||
echo "main.breakdown not found. Creating an empty main.breakdown file." | ||
touch main.breakdown | ||
else | ||
echo "main.breakdown found." | ||
fi | ||
- name: "Test Coverage" | ||
uses: vladopajic/go-test-coverage@v2 | ||
with: | ||
config: ./.testcoverage.yml | ||
# Save current coverage breakdown if current branch is main. It will be | ||
# uploaded as artifact in step below. | ||
breakdown-file-name: ${{ github.ref_name == 'main' && 'main.breakdown' || '' }} | ||
|
||
- name: Benchmark | ||
run: go test -bench=. -benchmem -run=none ./... | ||
# If this is not main branch we want to show report including | ||
# file coverage difference from main branch. | ||
diff-base-breakdown-file-name: ${{ steps.download-main-breakdown.outputs.found_artifact && 'main.breakdown' || 'main.breakdown' }} | ||
- name: Upload Artifact (main.breakdown) | ||
uses: actions/upload-artifact@v4 | ||
if: github.ref_name == 'main' | ||
with: | ||
name: main.breakdown | ||
path: main.breakdown # as specified via `breakdown-file-name` | ||
if-no-files-found: error | ||
- name: find if coverage report is already present | ||
if: ${{ github.event.pull_request.number != null }} | ||
uses: peter-evans/find-comment@v3 | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: 'go-test-coverage report:' | ||
- name: post coverage report | ||
if: ${{ github.event.pull_request.number != null }} | ||
uses: peter-evans/create-or-update-comment@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-id: ${{ steps.fc.outputs.comment-id || '' }} | ||
edit-mode: replace | ||
body: | | ||
go-test-coverage report: | ||
``` | ||
${{ steps.coverage.outputs.report && fromJSON(steps.coverage.outputs.report) || 'No coverage report available' }} ``` | ||
compatibility-test: | ||
strategy: | ||
matrix: | ||
go: [ "1.19", "1.20", "1.21", "1.22" ] | ||
- name: "finally check coverage" | ||
if: steps.coverage.outcome == 'failure' | ||
shell: bash | ||
run: echo "coverage check failed" && exit 1 | ||
unit-benchmark-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
cache: true # don't use cache for self-hosted runners | ||
- name: Unit Test | ||
run: go test -race -covermode=atomic ./... | ||
go-version: stable | ||
|
||
- name: Go BenchMark | ||
run: | | ||
modules=`find . -name "go.mod" -exec dirname {} \;` | ||
echo $modules | ||
list="" | ||
coverpkg="" | ||
if [[ ! -f "go.work" ]];then go work init;fi | ||
for module in $modules; do go work use $module; list=$module"/... "$list; coverpkg=$module"/...,"$coverpkg; done | ||
go work sync | ||
go test -bench=. -run=none $list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# (mandatory) | ||
# Path to coverage profile file (output of `go test -coverprofile` command). | ||
# | ||
# For cases where there are many coverage profiles, such as when running | ||
# unit tests and integration tests separately, you can combine all those | ||
# profiles into one. In this case, the profile should have a comma-separated list | ||
# of profile files, e.g., 'cover_unit.out,cover_integration.out'. | ||
profile: coverage.out | ||
|
||
# (optional; but recommended to set) | ||
# When specified reported file paths will not contain local prefix in the output. | ||
local-prefix: "github.com/cloudwego/eino" | ||
|
||
# Holds coverage thresholds percentages, values should be in range [0-100]. | ||
threshold: | ||
# (optional; default 0) | ||
# Minimum overall project coverage percentage required. | ||
total: 68 | ||
|
||
# Holds regexp rules which will exclude matched files or packages | ||
# from coverage statistics. | ||
exclude: | ||
# Exclude files or packages matching their paths | ||
paths: | ||
- "tests" | ||
- "examples/" | ||
- "mock/" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,17 @@ | ||
# .github | ||
# Eino Extend | ||
|
||
English | [中文](README.zh_CN.md) | ||
|
||
## Overview | ||
|
||
## Security | ||
|
||
If you discover a potential security issue in this project, or think you may | ||
have discovered a security issue, we ask that you notify Bytedance Security via | ||
our [security center](https://security.bytedance.com/src) or [vulnerability reporting email]([email protected]). | ||
|
||
Please do **not** create a public GitHub issue. | ||
|
||
## License | ||
|
||
This project is licensed under the [Apache-2.0 License](LICENSE.txt). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Eino Extend | ||
|
||
[English](README.md) | 中文 | ||
|
||
## 详细文档 | ||
|
||
// TODO:链接用户手册等文档 | ||
|
||
## 安全 | ||
|
||
如果你在该项目中发现潜在的安全问题,或你认为可能发现了安全问题,请通过我们的[安全中心](https://security.bytedance.com/src)或[漏洞报告邮箱]([email protected])通知字节跳动安全团队。 | ||
|
||
请**不要**创建公开的 GitHub Issue。 | ||
|
||
## 开源许可证 | ||
|
||
本项目依据 [Apache-2.0 许可证](LICENSE.txt) 授权。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
# Typo check: https://github.com/crate-ci/typos | ||
|
||
[default] | ||
|
||
[default.extend-words] | ||
Invokable = "Invokable" | ||
invokable = "invokable" | ||
InvokableLambda = "InvokableLambda" | ||
InvokableRun = "InvokableRun" | ||
|
||
|
||
[files] | ||
extend-exclude = ["go.mod", "go.sum", "check_branch_name.sh"] |
Oops, something went wrong.