build: github actions (#346)

* add workflows

* fix

* fix lint

* rpc tests

* build and format

* fix build errors

* remove dontcover

* update importer test

* more fixes

* lint

* split importer test

* fix

* remove tmp dir

* revert

* comment test import
This commit is contained in:
Federico Kunze
2020-06-26 18:26:55 -04:00
committed by GitHub
parent e9c494cf71
commit edf4357176
15 changed files with 353 additions and 194 deletions
+21 -19
View File
@@ -142,27 +142,16 @@ endif
test: test-unit
test-unit:
@${GO_MOD} go test -v --vet=off $(PACKAGES)
@go test -v ./... $(PACKAGES)
test-race:
@${GO_MOD} go test -v --vet=off -race $(PACKAGES)
test-cli:
@echo "NO CLI TESTS"
lint:
@echo "--> Running ci lint..."
GOBIN=$(PWD)/bin go run scripts/ci.go lint
@go test -v --vet=off -race ./... $(PACKAGES)
test-import:
@${GO_MOD} go test ./importer -v --vet=off --run=TestImportBlocks --datadir tmp \
@go test ./importer -v --vet=off --run=TestImportBlocks --datadir tmp \
--blockchain blockchain --timeout=10m
# TODO: remove tmp directory after test run to avoid subsequent errors
test-rpc:
@${GO_MOD} go test -v --vet=off ./tests/rpc_test
it-tests:
./scripts/integration-test-all.sh -q 1 -z 1 -s 2
godocs:
@@ -174,15 +163,28 @@ docker:
docker tag ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_IMAGE}:latest
docker tag ${DOCKER_IMAGE}:${DOCKER_TAG} ${DOCKER_IMAGE}:${COMMIT_HASH}
format:
@echo "--> Formatting go files"
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -w -s
@find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs misspell -w
.PHONY: build install update-tools tools godocs clean format lint \
test-cli test-race test-unit test test-import
###############################################################################
### Linting ###
###############################################################################
lint:
golangci-lint run --out-format=tab --issues-exit-code=0
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" | xargs gofmt -d -s
format:
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' | xargs gofmt -w -s
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' | xargs misspell -w
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' | xargs goimports -w -local github.com/tendermint
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' | xargs goimports -w -local github.com/ethereum/go-ethereum
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' | xargs goimports -w -local github.com/cosmos/cosmos-sdk
find . -name '*.go' -type f -not -path "./vendor*" -not -path "*.git*" -not -name '*.pb.go' | xargs goimports -w -local github.com/cosmos/ethermint
.PHONY: lint format
###############################################################################
### Protobuf ###
###############################################################################