gtsocial-umbx

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

Makefile (1572B)


      1 GOPATH := $(shell go env GOPATH)
      2 TMPDIR := $(shell mktemp -d)
      3 
      4 all: checks
      5 
      6 .PHONY: examples docs
      7 
      8 checks: lint vet test examples functional-test
      9 
     10 lint:
     11 	@mkdir -p ${GOPATH}/bin
     12 	@echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin
     13 	@echo "Running $@ check"
     14 	@GO111MODULE=on ${GOPATH}/bin/golangci-lint cache clean
     15 	@GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=5m --config ./.golangci.yml
     16 
     17 vet:
     18 	@GO111MODULE=on go vet ./...
     19 	@echo "Installing staticcheck" && go install honnef.co/go/tools/cmd/staticcheck@latest
     20 	${GOPATH}/bin/staticcheck -tests=false -checks="all,-ST1000,-ST1003,-ST1016,-ST1020,-ST1021,-ST1022,-ST1023,-ST1005"
     21 
     22 test:
     23 	@GO111MODULE=on SERVER_ENDPOINT=localhost:9000 ACCESS_KEY=minioadmin SECRET_KEY=minioadmin ENABLE_HTTPS=1 MINT_MODE=full go test -race -v ./...
     24 
     25 examples:
     26 	@echo "Building s3 examples"
     27 	@cd ./examples/s3 && $(foreach v,$(wildcard examples/s3/*.go),go build -mod=mod -o ${TMPDIR}/$(basename $(v)) $(notdir $(v)) || exit 1;)
     28 	@echo "Building minio examples"
     29 	@cd ./examples/minio && $(foreach v,$(wildcard examples/minio/*.go),go build -mod=mod -o ${TMPDIR}/$(basename $(v)) $(notdir $(v)) || exit 1;)
     30 
     31 functional-test:
     32 	@GO111MODULE=on go build -race functional_tests.go
     33 	@SERVER_ENDPOINT=localhost:9000 ACCESS_KEY=minioadmin SECRET_KEY=minioadmin ENABLE_HTTPS=1 MINT_MODE=full ./functional_tests
     34 
     35 clean:
     36 	@echo "Cleaning up all the generated files"
     37 	@find . -name '*.test' | xargs rm -fv
     38 	@find . -name '*~' | xargs rm -fv