diff options
author | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-02-26 19:54:48 +0100 |
---|---|---|
committer | Gabriel Arakaki Giovanini <mail@gabrielgio.me> | 2023-06-18 16:30:36 +0200 |
commit | c8e1328164e9ffbd681c3c0e449f1e6b9856b896 (patch) | |
tree | faee639a4c55c5dc3bfc59a5400026822c40221d /Makefile | |
download | lens-c8e1328164e9ffbd681c3c0e449f1e6b9856b896.tar.gz lens-c8e1328164e9ffbd681c3c0e449f1e6b9856b896.tar.bz2 lens-c8e1328164e9ffbd681c3c0e449f1e6b9856b896.zip |
feat: Inicial commit
It contains rough template for the server and runners.
It contains rough template for the server and runners.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9d82dd9 --- /dev/null +++ b/Makefile @@ -0,0 +1,59 @@ +BIN=img +OUT=./bin/$(BIN) +SERVER=./cmd/server/main.go + +GO_TEST=go test -v -timeout 100ms -shuffle on -parallel `nproc` +GO_BUILD=go build -v +GO_RUN=go run -v + +all: build sass + +build: + $(GO_BUILD) -o $(OUT) $(SERVER) + +run: sass + $(GO_RUN) $(SERVER) + +sass: + @mkdir -p static + sassc \ + -I scss scss/main.scss static/main.css \ + --style compressed + +test: test.unit test.integration + +test.all: gci test.unit test.integration lint + +test.integration: + $(GO_TEST) -tags=integration ./... + +test.unit: + $(GO_TEST) -tags=unit ./... + +gen: + go run -v \ + ./cmd/ggen/... + +cover.%: + $(GO_TEST) \ + -tags=$* \ + -coverprofile=bin/cover \ + ./... + go tool cover \ + -html=bin/cover \ + -o bin/cover.html + echo "open bin/cover.html" + +lint: + golangci-lint run \ + --fix \ + --config golangci.yml \ + --verbose \ + ./... + +gci: + find . \ + -type f \ + -name "*.go" \ + -not -path "./vendor/*" \ + -exec gci write -s standard -s default -s "prefix(git.sr.ht/~gabrielgio/img)" {} + |