Compare commits
2 Commits
1cc94f2c99
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 466d69c44c | |||
| abb0256f0b |
@@ -36,8 +36,8 @@ jobs:
|
|||||||
- name: Build UI assets
|
- name: Build UI assets
|
||||||
run: npm --prefix ./ui run build
|
run: npm --prefix ./ui run build
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run Go Tests
|
||||||
run: make test
|
run: make test-both
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: Build
|
name: Build
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
.PHONY: build ui ui-build run docker docker-build test clean help
|
.PHONY: build ui ui-build run docker docker-build test test-race test-both fmt clean help
|
||||||
|
|
||||||
APP_NAME := helix-proxy
|
APP_NAME := helix-proxy
|
||||||
GO := go
|
GO := go
|
||||||
@@ -22,6 +22,9 @@ help:
|
|||||||
@echo " docker Build docker image (helix-proxy:dev)"
|
@echo " docker Build docker image (helix-proxy:dev)"
|
||||||
@echo " docker-build Build docker image"
|
@echo " docker-build Build docker image"
|
||||||
@echo " test Run go tests"
|
@echo " test Run go tests"
|
||||||
|
@echo " test-race Run go tests with race detector"
|
||||||
|
@echo " test-both Run go tests and race detector"
|
||||||
|
@echo " fmt Format Go sources (gofmt)"
|
||||||
@echo " clean Remove build artifacts and ui/dist"
|
@echo " clean Remove build artifacts and ui/dist"
|
||||||
@echo ""
|
@echo ""
|
||||||
|
|
||||||
@@ -50,7 +53,24 @@ docker docker-build:
|
|||||||
docker build -t helix-proxy:dev .
|
docker build -t helix-proxy:dev .
|
||||||
|
|
||||||
test:
|
test:
|
||||||
$(GO) test ./... -count=1 -race -coverprofile=coverage.out
|
$(GO) test ./... -count=1
|
||||||
|
|
||||||
|
test-race:
|
||||||
|
$(GO) test ./... -count=1 -race
|
||||||
|
|
||||||
|
test-both: test test-race
|
||||||
|
|
||||||
|
fmt:
|
||||||
|
@echo "Formatting Go sources..."
|
||||||
|
@files="$$(gofmt -l .)"; \
|
||||||
|
if [ -n "$$files" ]; then \
|
||||||
|
count=$$(echo "$$files" | wc -l); \
|
||||||
|
echo "Reformatted $$count file(s):"; \
|
||||||
|
echo "$$files" | sed 's/^/ /'; \
|
||||||
|
echo "$$files" | xargs gofmt -w; \
|
||||||
|
else \
|
||||||
|
echo "All Go files already formatted."; \
|
||||||
|
fi
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(APP_NAME)
|
rm -f $(APP_NAME)
|
||||||
|
|||||||
Reference in New Issue
Block a user