-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separated drivers
- Loading branch information
Showing
162 changed files
with
1,550 additions
and
2,084 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 |
---|---|---|
|
@@ -112,30 +112,40 @@ jobs: | |
- name: Tests with real databases | ||
run: make test.coverage.with_real_db | ||
|
||
- name: Code coverage data | ||
run: | | ||
set -x | ||
COVERAGE_TOTAL=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'` | ||
echo "COVERAGE_TOTAL=$COVERAGE_TOTAL" >> $GITHUB_ENV | ||
- uses: jandelgado/[email protected] | ||
with: | ||
outfile: ./coverage.lcov | ||
|
||
- name: Coveralls | ||
uses: coverallsapp/github-action@master | ||
uses: coverallsapp/github-action@v2 | ||
with: | ||
path-to-lcov: ./coverage.lcov | ||
format: golang | ||
file: ./coverage.out | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
golangci: | ||
name: lint | ||
# https://github.com/golangci/golangci-lint/issues/828 | ||
generate-pkgs-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- name: Fetch Repository | ||
uses: actions/checkout@v4 | ||
- id: set-matrix | ||
run: | | ||
DIRECTORIES=$(find . -not -path "*/vendor/*" -type f -name go.mod -exec sh -c 'echo $(dirname {})' \; | jq -R -s -c 'split("\n")[:-1]') | ||
echo "matrix=${DIRECTORIES}" >> $GITHUB_OUTPUT | ||
lint: | ||
needs: generate-pkgs-matrix | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
modules: ${{fromJson(needs.generate-pkgs-matrix.outputs.matrix)}} | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
- name: Fetch Repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: ${{ env.GO_TARGET_VERSION }} | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
args: --timeout=3m -v | ||
working-directory: ${{ matrix.modules }} |
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 |
---|---|---|
|
@@ -28,3 +28,4 @@ vendor/ | |
|
||
# Code coverage | ||
coverage.* | ||
coverage/ |
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 |
---|---|---|
@@ -1,25 +1,58 @@ | ||
CVPKG=go list ./... | grep -v mocks | grep -v internal/ | ||
GO_TEST=go test `$(CVPKG)` -race | ||
GO_TEST_WITH_REAL_DB=$(GO_TEST) --tags=with_real_db | ||
COVERAGE_FILE="coverage.out" | ||
DIR=$(PWD) | ||
|
||
GO_TEST=cd ./sh && bash ./go.test.sh | ||
GO_TEST_COVERAGE=cd ./sh && bash ./go.test.coverage.sh | ||
|
||
GO_TEST_WITH_REAL_DB=--tags=with_real_db | ||
|
||
test: | ||
$(GO_TEST) | ||
|
||
test.with_real_db: | ||
$(GO_TEST_WITH_REAL_DB) | ||
$(GO_TEST) $(GO_TEST_WITH_REAL_DB) | ||
|
||
test.coverage: | ||
$(GO_TEST) -covermode=atomic -coverprofile=$(COVERAGE_FILE) | ||
$(GO_TEST_COVERAGE) | ||
|
||
test.coverage.with_real_db: | ||
$(GO_TEST_WITH_REAL_DB) -covermode=atomic -coverprofile=$(COVERAGE_FILE) | ||
$(GO_TEST_COVERAGE) $(GO_TEST_WITH_REAL_DB) | ||
|
||
fmt: | ||
go fmt ./... | ||
cd sh && sh ./go.fmt.sh | ||
|
||
lint: | ||
golangci-lint run -v --timeout=2m | ||
cd sh && sh ./lint.sh | ||
|
||
lint.verbose: | ||
cd sh && sh ./lint.sh -v | ||
|
||
lint.cache.clean: | ||
golangci-lint cache clean | ||
|
||
generate: | ||
go generate ./... | ||
|
||
go.mod.tidy: | ||
cd sh && sh ./go.mod.tidy.sh | ||
|
||
go.mod.vendor: | ||
cd sh && sh ./go.mod.vendor.sh | ||
|
||
go.work.sync: | ||
go work sync | ||
|
||
|
||
tag: git.tag tag.pkg | ||
|
||
tag.pkg: | ||
cd sh && sh ./tag.pkg.sh $(version) | ||
|
||
git.tag: git.tag.create git.tag.push | ||
|
||
# 1.0, "v2." added automatically | ||
# make git.tag version="0.0-rc1" | ||
git.tag.create: | ||
cd sh && sh ./git.tag.sh $(version) | ||
|
||
git.tag.push: | ||
git push origin --tags |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module github.com/avito-tech/go-transaction-manager/drivers/goredis8/v2 | ||
|
||
go 1.14 | ||
|
||
require ( | ||
github.com/avito-tech/go-transaction-manager/trm/v2 v2.0.0-rc6 | ||
github.com/go-redis/redis/v8 v8.11.5 | ||
github.com/go-redis/redismock/v8 v8.11.5 | ||
github.com/kr/pretty v0.3.0 // indirect | ||
github.com/rogpeppe/go-internal v1.12.0 // indirect | ||
github.com/stretchr/testify v1.8.2 | ||
golang.org/x/net v0.10.0 // indirect | ||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | ||
) |
Oops, something went wrong.