Skip to content

Commit

Permalink
Add -mod=vendor in Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
fguillot committed Dec 29, 2018
1 parent 79e7d00 commit 362fc5c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ LD_FLAGS := "-s -w -X 'miniflux.app/version.Version=$(VERSION)' -X 'miniflux.app
PKG_LIST := $(shell go list ./... | grep -v /vendor/)
DB_URL := postgres://postgres:postgres@localhost/miniflux_test?sslmode=disable

export GO111MODULE=on

.PHONY: generate
.PHONY: miniflux
.PHONY: linux-amd64
Expand All @@ -19,7 +21,7 @@ DB_URL := postgres://postgres:postgres@localhost/miniflux_test?sslmode=disable
.PHONY: build run clean test lint integration-test clean-integration-test

generate:
@ go generate
@ go generate -mod=vendor

miniflux: generate
@ go build -mod=vendor -ldflags=$(LD_FLAGS) -o $(APP) main.go
Expand Down Expand Up @@ -54,26 +56,26 @@ windows-amd64: generate
build: linux-amd64 linux-armv8 linux-armv7 linux-armv6 linux-armv5 darwin-amd64 freebsd-amd64 openbsd-amd64 windows-amd64

run: generate
@ go run main.go -debug
@ go run -mod=vendor main.go -debug

clean:
@ rm -f $(APP)-* $(APP)

test:
go test -cover -race -count=1 ./...
go test -mod=vendor -cover -race -count=1 ./...

lint:
@ golint -set_exit_status ${PKG_LIST}

integration-test:
psql -U postgres -c 'drop database if exists miniflux_test;'
psql -U postgres -c 'create database miniflux_test;'
DATABASE_URL=$(DB_URL) go run main.go -migrate
DATABASE_URL=$(DB_URL) ADMIN_USERNAME=admin ADMIN_PASSWORD=test123 go run main.go -create-admin
go build -o miniflux-test main.go
DATABASE_URL=$(DB_URL) go run -mod=vendor main.go -migrate
DATABASE_URL=$(DB_URL) ADMIN_USERNAME=admin ADMIN_PASSWORD=test123 go run -mod=vendor main.go -create-admin
go build -mod=vendor -o miniflux-test main.go
DATABASE_URL=$(DB_URL) ./miniflux-test -debug >/tmp/miniflux.log 2>&1 & echo "$$!" > "/tmp/miniflux.pid"
while ! echo exit | nc localhost 8080; do sleep 1; done >/dev/null
go test -v -tags=integration -count=1 miniflux.app/tests || cat /tmp/miniflux.log
go test -mod=vendor -v -tags=integration -count=1 miniflux.app/tests || cat /tmp/miniflux.log

clean-integration-test:
@ kill -9 `cat /tmp/miniflux.pid`
Expand Down

0 comments on commit 362fc5c

Please sign in to comment.