diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..64a5995 --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,30 @@ +name: zk +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] +jobs: + build: + runs-on: ubuntu-20.04 + services: + zookeeper: + image: zookeeper:3.9.2 + ports: + - 2181:2181 + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: "1.21.9" + - name: Lint + run: make lint + - name: Test + run: make test + - name: Convert coverage.out to coverage.lcov + uses: jandelgado/gcov2lcov-action@v1.0.6 + - name: Coveralls + uses: coverallsapp/github-action@v1.1.2 + with: + github-token: ${{ secrets.github_token }} + path-to-lcov: coverage.lcov diff --git a/.gitignore b/.gitignore index f1b1132..baf20c8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,5 +7,5 @@ /apache-zookeeper-*/ /apache-zookeeper-*.tar.gz /.idea -/coverage.cov +/coverage.out /bin diff --git a/Makefile b/Makefile index 67fecf1..af7ed72 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,10 @@ -.PHONY: test build coverage +.PHONY: test lint build coverage test: - go test -race -p 1 -count=1 -tags=integration -covermode=atomic -coverprofile=coverage.cov ./... + go test -race -p 1 -count=1 -tags=integration -covermode=atomic -coverprofile=coverage.out ./... + +lint: + echo "Do nothing" build: go build -o bin/lock test-examples/lock/main.go diff --git a/go.mod b/go.mod index 80d19c6..1135e73 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/QuangTung97/zk -go 1.19 +go 1.21.2 require github.com/stretchr/testify v1.9.0 diff --git a/todolist b/todolist index 2ad7e07..a16a2f9 100644 --- a/todolist +++ b/todolist @@ -1,4 +1,5 @@ *) Add CI Pipeline for Integration Tests +*) Add Lint *) Batching Read & Write to TCP (Need to do or not?) *) Stress Tests with Race Detector *) Add Multi-Ops Transactions