forked from apache/pulsar
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable action CI on Go Functions (apache#6053)
Motivation - Enable action CI on Go Functions Modifications - add test check for Go function - add code style check for Go Function * Enable action CI on Go Functions Signed-off-by: xiaolong.ran <[email protected]> * ignore non-go files Signed-off-by: xiaolong.ran <[email protected]> * remove go build Signed-off-by: xiaolong.ran <[email protected]> * fix ci error Signed-off-by: xiaolong.ran <[email protected]> * fix ci error Signed-off-by: xiaolong.ran <[email protected]> * fix ci error Signed-off-by: xiaolong.ran <[email protected]> * fix ci error Signed-off-by: xiaolong.ran <[email protected]> * fix ci error Signed-off-by: xiaolong.ran <[email protected]> * fix go mod file Signed-off-by: xiaolong.ran <[email protected]> * fix ci error Signed-off-by: xiaolong.ran <[email protected]> * fix ci error Signed-off-by: xiaolong.ran <[email protected]> * fix ci error Signed-off-by: xiaolong.ran <[email protected]> * code format Signed-off-by: xiaolong.ran <[email protected]> * fix test case Signed-off-by: xiaolong.ran <[email protected]> * fix license header Signed-off-by: xiaolong.ran <[email protected]>
- Loading branch information
Showing
11 changed files
with
182 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# | ||
# 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. | ||
# | ||
|
||
name: CI - Go Functions style check | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- '.github/workflows/**' | ||
- 'pulsar-function-go/**' | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.12 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.12 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: InstallTool | ||
run: | | ||
cd pulsar-function-go | ||
wget -O - -q https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s v1.18.0 | ||
./bin/golangci-lint --version | ||
- name: Build | ||
run: | | ||
cd pulsar-function-go | ||
go build ./pf | ||
- name: CheckStyle | ||
run: | | ||
cd pulsar-function-go | ||
./bin/golangci-lint run -c ./golangci.yml ./pf |
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,49 @@ | ||
# | ||
# 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. | ||
# | ||
|
||
name: CI - Go Functions Tests | ||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
paths: | ||
- '.github/workflows/**' | ||
- 'pulsar-function-go/**' | ||
|
||
jobs: | ||
|
||
cpp-tests: | ||
name: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 120 | ||
|
||
steps: | ||
- name: Set up Go 1.12 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.12 | ||
id: go | ||
|
||
- name: checkout | ||
uses: actions/checkout@v1 | ||
|
||
- name: run tests | ||
run: | | ||
cd pulsar-function-go | ||
go test -v $(go list ./... | grep -v examples) |
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,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. | ||
# | ||
|
||
run: | ||
deadline: 6m | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- bodyclose | ||
- deadcode | ||
- gocritic | ||
- goimports | ||
- golint | ||
- gosimple | ||
- govet | ||
- ineffassign | ||
- interfacer | ||
- misspell | ||
- staticcheck | ||
- structcheck | ||
- stylecheck | ||
- typecheck | ||
- unconvert | ||
- unparam | ||
- unused | ||
- varcheck | ||
- lll | ||
- prealloc |
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
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
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
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