2022-07-03 11:08:30 +01:00
|
|
|
GOPATH := $(shell go env GOPATH)
|
|
|
|
TMPDIR := $(shell mktemp -d)
|
|
|
|
|
|
|
|
all: checks
|
|
|
|
|
|
|
|
.PHONY: examples docs
|
|
|
|
|
|
|
|
checks: lint vet test examples functional-test
|
|
|
|
|
|
|
|
lint:
|
|
|
|
@mkdir -p ${GOPATH}/bin
|
2022-11-07 10:20:43 +00:00
|
|
|
@echo "Installing golangci-lint" && curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOPATH)/bin
|
2022-07-03 11:08:30 +01:00
|
|
|
@echo "Running $@ check"
|
|
|
|
@GO111MODULE=on ${GOPATH}/bin/golangci-lint cache clean
|
|
|
|
@GO111MODULE=on ${GOPATH}/bin/golangci-lint run --timeout=5m --config ./.golangci.yml
|
|
|
|
|
|
|
|
vet:
|
|
|
|
@GO111MODULE=on go vet ./...
|
2023-01-16 09:29:47 +00:00
|
|
|
@echo "Installing staticcheck" && go install honnef.co/go/tools/cmd/staticcheck@latest
|
|
|
|
${GOPATH}/bin/staticcheck -tests=false -checks="all,-ST1000,-ST1003,-ST1016,-ST1020,-ST1021,-ST1022,-ST1023,-ST1005"
|
2022-07-03 11:08:30 +01:00
|
|
|
|
|
|
|
test:
|
2023-04-19 12:43:42 +01:00
|
|
|
@GO111MODULE=on SERVER_ENDPOINT=localhost:9000 ACCESS_KEY=minioadmin SECRET_KEY=minioadmin ENABLE_HTTPS=1 MINT_MODE=full go test -race -v ./...
|
2022-07-03 11:08:30 +01:00
|
|
|
|
|
|
|
examples:
|
|
|
|
@echo "Building s3 examples"
|
|
|
|
@cd ./examples/s3 && $(foreach v,$(wildcard examples/s3/*.go),go build -mod=mod -o ${TMPDIR}/$(basename $(v)) $(notdir $(v)) || exit 1;)
|
|
|
|
@echo "Building minio examples"
|
|
|
|
@cd ./examples/minio && $(foreach v,$(wildcard examples/minio/*.go),go build -mod=mod -o ${TMPDIR}/$(basename $(v)) $(notdir $(v)) || exit 1;)
|
|
|
|
|
|
|
|
functional-test:
|
2022-11-07 10:20:43 +00:00
|
|
|
@GO111MODULE=on go build -race functional_tests.go
|
2023-04-19 12:43:42 +01:00
|
|
|
@SERVER_ENDPOINT=localhost:9000 ACCESS_KEY=minioadmin SECRET_KEY=minioadmin ENABLE_HTTPS=1 MINT_MODE=full ./functional_tests
|
2022-07-03 11:08:30 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
@echo "Cleaning up all the generated files"
|
|
|
|
@find . -name '*.test' | xargs rm -fv
|
|
|
|
@find . -name '*~' | xargs rm -fv
|