Skip to content

Commit

Permalink
Merge pull request apache#1160 from walterlife/walterlife/workflow
Browse files Browse the repository at this point in the history
[ISSUE apache#276] Support serverless workflow
  • Loading branch information
qqeasonchen authored Aug 16, 2022
2 parents 075492e + 6483818 commit ccfc060
Show file tree
Hide file tree
Showing 39 changed files with 3,456 additions and 2 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ logs
build
.classpath
.project
.checkstyle
test-output
dist
.pmd
Expand All @@ -22,7 +21,7 @@ package-lock.json
node_modules
.DS_Store
.run
/**/bin
*.log

h2/db.mv.db

Expand Down
99 changes: 99 additions & 0 deletions eventmesh-workflow-go/.golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

linters-settings:
funlen:
lines: 80
statements: 80
goconst:
min-len: 2
min-occurrences: 3
gocyclo:
min-complexity: 20
golint:
min-confidence: 0
govet:
check-shadowing: true
lll:
line-length: 120
errcheck:
check-type-assertions: false
gocritic:
enabled-checks:
- nestingReduce
settings:
nestingReduce:
bodyWidth: 5

linters:
disable-all: true
enable:
- deadcode
- funlen
- goconst
- gocyclo
- gofmt
- ineffassign
- staticcheck
- structcheck
- goimports
- revive
- gosimple
- govet
- typecheck
- lll
- rowserrcheck
- errcheck
- unused
- varcheck
- sqlclosecheck

run:
timeout: 20m

issues:
exclude-use-default: true

# The list of ids of default excludes to include or disable. By default it's empty.
include:
- EXC0004 # govet (possible misuse of unsafe.Pointer|should have signature)
- EXC0005 # staticcheck ineffective break statement. Did you mean to break out of the outer loop
- EXC0011 # stylecheck (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form)
- EXC0012 # revive exported (method|function|type|const) (.+) should have comment or be unexported

exclude-rules:
- path: _test\.go
linters:
- funlen
- linters:
- staticcheck
text: "SA6002: argument should be pointer-like to avoid allocations" # sync.pool.Put(buf), slice `var buf []byte` will tiger this
- linters:
- structcheck
text: "Store` is unused"
- linters:
- lll
source: "^//go:generate "

max-same-issues: 0
new: false
max-issues-per-linter: 0

output:
sort-results: true

service:
golangci-lint-version: 1.23.x
45 changes: 45 additions & 0 deletions eventmesh-workflow-go/.licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#

header:
license:
spdx-id: Apache-2.0
copyright-owner: Apache Software Foundation

paths-ignore:
- '.github/PULL_REQUEST_TEMPLATE'
- '.gitmodules'
- '**/.gitkeep'
- '**/.gitignore'
- '**/*.md'
- '**/*.json'
- '**/*.ftl'
- '**/*.iml'
- '**/*.ini'
- '**/*.crt'
- '**/*.pem'
- '**/go.sum'
- 'LICENSE'
- 'NOTICE'
- 'DISCLAIMER-WIP'
- 'gradlew'
- 'gradlew.bat'
- '**/*.pb.go'

comment: on-failure
40 changes: 40 additions & 0 deletions eventmesh-workflow-go/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

lint:
golangci-lint run --tests=false
build:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o ${SERVER}
# goimports
# -e report all errors (not just the first 10 on different lines)
# -d display diffs instead of rewriting files
# -local put imports beginning with this string after 3rd-party packages; comma-separated list
# gofmt
# -e report all errors (not just the first 10 on different lines)
# -d display diffs instead of rewriting files
# -s simplify code
# -w write result to (source) file instead of stdout
fmt:
find . -name "*.go" | xargs goimports -e -d -local git.code.oa.com -w && \
find . -name "*.go" | xargs gofmt -e -d -s -w
test:
go test -v ./... -gcflags "all=-N -l"

cover:
go test ./... -gcflags "all=-N -l" --covermode=count -coverprofile=cover.out.tmp
cat cover.out.tmp | grep -v "_mock.go" | grep -v ".pb.go" > cover.out
rm cover.out.tmp
go tool cover -html=cover.out
Loading

0 comments on commit ccfc060

Please sign in to comment.