This is an automated email from the ASF dual-hosted git repository. sijie pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/pulsar-client-go.git
The following commit(s) were added to refs/heads/master by this push: new 9b739cf Enable Github Action CI (#170) 9b739cf is described below commit 9b739cf9d098a0a2f51307027f7985e7f3d1ab95 Author: 冉小龙 <r...@apache.org> AuthorDate: Mon Jan 13 16:54:34 2020 +0800 Enable Github Action CI (#170) Signed-off-by: xiaolong.ran <r...@apache.org> Master Issue: #169 ### Modifications - Replace Apache Jenkins with Github Action CI --- .github/workflows/go.yml | 17 +++++------------ .github/workflows/project.yml | 29 +++++++++++++++++++++++++++++ docker-ci.sh | 3 --- pulsar/consumer_partition.go | 2 +- 4 files changed, 35 insertions(+), 16 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 14bd4f2..81745e9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -1,5 +1,5 @@ name: Go -on: [push] +on: [pull_request] jobs: build: @@ -7,22 +7,15 @@ jobs: runs-on: ubuntu-latest steps: - - name: Set up Go 1.13 + - name: Set up Go 1.12 uses: actions/setup-go@v1 with: - go-version: 1.13 + go-version: 1.12 id: go - name: Check out code into the Go module directory uses: actions/checkout@v1 - - name: Get dependencies + - name: Test run: | - go get -v -t -d ./... - if [ -f Gopkg.toml ]; then - curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure - fi - - - name: Build - run: go build -v . + ./docker-ci.sh diff --git a/.github/workflows/project.yml b/.github/workflows/project.yml new file mode 100644 index 0000000..60f7654 --- /dev/null +++ b/.github/workflows/project.yml @@ -0,0 +1,29 @@ +name: Project Style Check +on: [pull_request] +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: | + 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: go build ./pulsar + + - name: CheckStyle + run: | + ./bin/golangci-lint run -c ./.golangci.yml ./... diff --git a/docker-ci.sh b/docker-ci.sh index f6924db..d711ee8 100755 --- a/docker-ci.sh +++ b/docker-ci.sh @@ -20,9 +20,6 @@ set -e -x -# Project code style check -docker run --rm -v $(pwd):/app -w /app golangci/golangci-lint:v1.21.0 golangci-lint run -v -c ./.golangci.yml ./... - SRC_DIR=$(git rev-parse --show-toplevel) cd ${SRC_DIR} diff --git a/pulsar/consumer_partition.go b/pulsar/consumer_partition.go index e8a8ebd..ae07e76 100644 --- a/pulsar/consumer_partition.go +++ b/pulsar/consumer_partition.go @@ -469,7 +469,7 @@ func (pc *partitionConsumer) dispatcher() { case clearQueueCb := <-pc.clearQueueCh: // drain the message queue on any new connection by sending a // special nil message to the channel so we know when to stop dropping messages - var nextMessageInQueue *messageID = nil + var nextMessageInQueue *messageID go func() { pc.queueCh <- nil }()