Skip to content

Commit

Permalink
Split make deps and make deps-check.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlekSi committed Mar 20, 2019
1 parent 58ae6bd commit 44fd84c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions Makefile
@@ -1,12 +1,14 @@
all: test-dc check
help: ## Display this help message.
@echo "Please use \`make <target>\` where <target> is one of:"
@grep '^[a-zA-Z]' $(MAKEFILE_LIST) | \
awk -F ':.*?## ' 'NF==2 {printf " %-26s%s\n", $$1, $$2}'

# extra flags like -v
REFORM_TEST_FLAGS ?=

# SHELL = go run .github/shell.go

# install dependencies
deps:
deps: ## Install dependencies.
go get -u github.com/lib/pq
go get -u github.com/jackc/pgx/stdlib
go get -u github.com/go-sql-driver/mysql
Expand All @@ -18,14 +20,13 @@ deps:
go get -u github.com/brianvoe/gofakeit
go get -u github.com/stretchr/testify/...

deps-check: ## Install linters.
curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(shell go env GOPATH)/bin

# run all linters
check:
check: ## Run linters.
$(shell go env GOPATH)/bin/golangci-lint run ./...

# run unit tests, generate models, install tools
test:
test: ## Run unit tests, generate models, install tools.
rm -f *.cover coverage.txt
rm -f internal/test/models/*_reform.go
rm -f reform-db/*_reform.go
Expand All @@ -38,8 +39,7 @@ test:
go generate -v -x gopkg.in/reform.v1/reform-db
go install -v gopkg.in/reform.v1/reform-db

# initialize database and run integration tests
test-db:
test-db: ## Initialize database and run integration tests.
-reform-db -db-driver="$(REFORM_DRIVER)" -db-source="$(REFORM_ROOT_SOURCE)" -db-wait=15s exec \
internal/test/sql/$(REFORM_DATABASE)_drop.sql
reform-db -db-driver="$(REFORM_DRIVER)" -db-source="$(REFORM_ROOT_SOURCE)" exec \
Expand All @@ -62,8 +62,7 @@ test-db:
gocoverutil -coverprofile=coverage.txt merge *.cover
rm -f *.cover

# run all integration tests with Docker Compose
test-dc:
test-dc: ## Run all integration tests with Docker Compose.
go run .github/test-dc.go test

# run unit tests and integration tests for PostgreSQL (postgres driver)
Expand Down

0 comments on commit 44fd84c

Please sign in to comment.