Skip to content

Commit bd71ffe

Browse files
authored
Initial commit
0 parents  commit bd71ffe

16 files changed

+694
-0
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
12+
A clear and concise description of what the bug is.
13+
14+
**To Reproduce**
15+
16+
Steps to reproduce the behavior:
17+
1. Go to '...'
18+
2. Click on '....'
19+
3. Scroll down to '....'
20+
4. See error
21+
22+
**Expected behavior**
23+
24+
A clear and concise description of what you expected to happen.
25+
26+
**Screenshots**
27+
28+
If applicable, add screenshots to help explain your problem.
29+
30+
**Kitex version:**
31+
32+
Please provide the version of Kitex you are using.
33+
34+
**Environment:**
35+
36+
The output of `go env`.
37+
38+
**Additional context**
39+
40+
Add any other context about the problem here.
+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
12+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
13+
14+
**Describe the solution you'd like**
15+
16+
A clear and concise description of what you want to happen.
17+
18+
**Describe alternatives you've considered**
19+
20+
A clear and concise description of any alternative solutions or features you've considered.
21+
22+
**Additional context**
23+
24+
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#### What type of PR is this?
2+
<!--
3+
Add one of the following kinds:
4+
5+
build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
6+
ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
7+
docs: Documentation only changes
8+
feat: A new feature
9+
optimize: A new optimization
10+
fix: A bug fix
11+
perf: A code change that improves performance
12+
refactor: A code change that neither fixes a bug nor adds a feature
13+
style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc)
14+
test: Adding missing tests or correcting existing tests
15+
chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
16+
-->
17+
18+
#### Check the PR title.
19+
<!--
20+
The description of the title will be attached in Release Notes,
21+
so please describe it from user-oriented, what this PR does / why we need it.
22+
Please check your PR title with the below requirements:
23+
-->
24+
- [ ] This PR title match the format: \<type\>(optional scope): \<description\>
25+
- [ ] The description of this PR title is user-oriented and clear enough for others to understand.
26+
- [ ] Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. [User docs repo](https://github.com/cloudwego/cloudwego.github.io)
27+
28+
29+
#### (Optional) Translate the PR title into Chinese.
30+
31+
32+
#### (Optional) More detailed description for this PR(en: English/zh: Chinese).
33+
<!--
34+
Provide more detailed info for review(e.g., it's recommended to provide perf data if this is a perf type PR).
35+
-->
36+
en:
37+
zh(optional):
38+
39+
40+
#### (Optional) Which issue(s) this PR fixes:
41+
<!--
42+
Automatically closes linked issue when PR is merged.
43+
Eg: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
44+
-->
45+
46+
#### (optional) The PR that updates user documentation:
47+
<!--
48+
If the current PR requires user awareness at the usage level, please submit a PR to update user docs. [User docs repo](https://github.com/cloudwego/cloudwego.github.io)
49+
-->

.github/workflows/pr-check.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Pull Request Check
2+
3+
on: [ pull_request ]
4+
5+
jobs:
6+
compliant:
7+
runs-on: [ self-hosted, X64 ]
8+
steps:
9+
- uses: actions/checkout@v3
10+
11+
- name: Check License Header
12+
uses: apache/skywalking-eyes/header@main
13+
env:
14+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
16+
- name: Check Spell
17+
uses: crate-ci/typos@master
18+
19+
staticcheck:
20+
runs-on: [ self-hosted, X64 ]
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Set up Go
24+
uses: actions/setup-go@v3
25+
with:
26+
go-version: 1.19
27+
28+
- uses: actions/cache@v3
29+
with:
30+
path: ~/go/pkg/mod
31+
key: reviewdog-${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
32+
restore-keys: |
33+
reviewdog-${{ runner.os }}-go-
34+
35+
- uses: reviewdog/action-staticcheck@v1
36+
with:
37+
github_token: ${{ secrets.github_token }}
38+
# Change reviewdog reporter if you need [github-pr-check,github-check,github-pr-review].
39+
reporter: github-pr-review
40+
# Report all results.
41+
filter_mode: nofilter
42+
# Exit with 1 when it find at least one finding.
43+
fail_on_error: true
44+
# Set staticcheck flags
45+
staticcheck_flags: -checks=inherit,-SA1029
46+
47+
lint:
48+
runs-on: [ self-hosted, X64 ]
49+
steps:
50+
- uses: actions/checkout@v3
51+
- name: Set up Go
52+
uses: actions/setup-go@v3
53+
with:
54+
go-version: 1.19
55+
56+
- name: Golangci Lint
57+
# https://golangci-lint.run/
58+
uses: golangci/golangci-lint-action@v3
59+
with:
60+
version: latest

.github/workflows/release-check.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- name: Check Source Branch
15+
run: python2 -c "exit(0 if '${{ github.head_ref }}'.startswith('release') or '${{ github.head_ref }}'.startswith('hotfix') else 1)"
16+
17+
- name: Check Version
18+
run: |
19+
# get version code, runner not support grep -E here
20+
SOURCE_VERSION=`grep 'Version\s*=\s*\"v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\"' *.go | awk -F '\"' '{print $(NF-1)}'`
21+
git checkout main
22+
MASTER_VERSION=`grep 'Version\s*=\s*\"v[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\"' *.go | awk -F '\"' '{print $(NF-1)}'`
23+
git checkout ${{Head.SHA}}
24+
# check version update
25+
python2 -c "exit(0 if list(map(int,'${SOURCE_VERSION#v}'.split('.')[:3])) > list(map(int,'${MASTER_VERSION#v}'.split('.')[:3])) else 1)"

.github/workflows/tests.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Tests
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
unit-benchmark-test:
7+
strategy:
8+
matrix:
9+
go: [ 1.17, 1.18, 1.19 ]
10+
os: [ X64, ARM64 ]
11+
runs-on: ${{ matrix.os }}
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Set up Go
16+
uses: actions/setup-go@v3
17+
with:
18+
go-version: ${{ matrix.go }}
19+
20+
# block scenario, comment temporarily
21+
# - uses: actions/cache@v3
22+
# with:
23+
# path: ~/go/pkg/mod
24+
# key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
25+
# restore-keys: |
26+
# ${{ runner.os }}-go-
27+
28+
- name: Unit Test
29+
run: go test -race -covermode=atomic -coverprofile=coverage.out ./...
30+
31+
- name: Benchmark
32+
run: go test -bench=. -benchmem -run=none ./...

.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Binaries for programs and plugins
2+
*.exe
3+
*.exe~
4+
*.dll
5+
*.so
6+
*.dylib
7+
8+
# Test binary, built with `go test -c`
9+
*.test
10+
11+
# Output of the go coverage tool, specifically when used with LiteIDE
12+
*.out
13+
14+
# Dependency directories (remove the comment below to include it)
15+
# vendor/
16+
17+
# the result of the go build
18+
output*
19+
output/*
20+
21+
# Files generated by IDEs
22+
.idea/
23+
*.iml
24+
25+
# Vim swap files
26+
*.swp
27+
28+
# Vscode files
29+
.vscode
30+

.golangci.yaml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Options for analysis running.
2+
run:
3+
# include `vendor` `third_party` `testdata` `examples` `Godeps` `builtin`
4+
skip-dirs-use-default: true
5+
skip-dirs:
6+
- kitex_gen
7+
skip-files:
8+
- ".*\\.mock\\.go$"
9+
# output configuration options
10+
output:
11+
# Format: colored-line-number|line-number|json|tab|checkstyle|code-climate|junit-xml|github-actions
12+
format: colored-line-number
13+
# All available settings of specific linters.
14+
# Refer to https://golangci-lint.run/usage/linters
15+
linters-settings:
16+
gofumpt:
17+
# Choose whether to use the extra rules.
18+
# Default: false
19+
extra-rules: true
20+
govet:
21+
# Disable analyzers by name.
22+
# Run `go tool vet help` to see all analyzers.
23+
disable:
24+
- stdmethods
25+
linters:
26+
enable:
27+
- gofumpt
28+
- gofmt
29+
disable:
30+
- errcheck
31+
- typecheck
32+
- deadcode
33+
- varcheck
34+
- staticcheck
35+
issues:
36+
exclude-use-default: true

.licenserc.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
header:
2+
license:
3+
spdx-id: Apache-2.0
4+
copyright-owner: CloudWeGo Authors
5+
6+
paths:
7+
- '**/*.go'
8+
- '**/*.s'
9+
10+
comment: on-failure

0 commit comments

Comments
 (0)