-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
45 lines (34 loc) · 1.05 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
SHELL=/bin/bash
# options: openshift, local
CLI_STRATEGY ?= local
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
GOLANGCI_LINT_VERSION ?= v1.54.2
golangci-lint:
@[ -f $(GOLANGCI_LINT) ] || { \
set -e ;\
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell dirname $(GOLANGCI_LINT)) $(GOLANGCI_LINT_VERSION) ;\
}
.PHONY: lint
lint: golangci-lint ## Run golangci-lint linter & yamllint
$(GOLANGCI_LINT) run
.PHONY: lint-fix
lint-fix: golangci-lint ## Run golangci-lint linter and perform fixes
$(GOLANGCI_LINT) run --fix
all: build env test
env:
@./tas-env-variables.sh > .env
build:
go build ./...
test:
@echo "Running tests..."
@if [ -f .env ]; then \
echo "Loading environment variables from .env"; \
set -o allexport && source .env && set +o allexport; \
else \
echo ".env file not found, running tests without environment variables"; \
fi; \
go test -v ./test/...
tuf-repo:
@echo "Running manual TUF repository test..."
go test -v ./test/tuftool
.PHONY: build test test-tuf-repo all