JOJ3/Makefile
张泊明518370910136 149ea41b1c
All checks were successful
submodules sync / sync (push) Successful in 39s
build / build (push) Successful in 1m16s
build / trigger-build-image (push) Successful in 7s
chore(test): remove coverage generation
2025-03-06 15:12:57 -05:00

35 lines
848 B
Makefile

.PHONY: all build clean lint prepare-test test ci-test
BUILD_DIR := ./build
TMP_DIR := ./tmp
APPS := $(notdir $(wildcard ./cmd/*))
COMMIT_HASH := $(shell git rev-parse --short HEAD)
DATE := $(shell date +"%Y%m%d-%H%M%S")
VERSION := $(COMMIT_HASH)-$(DATE)
FLAGS := "-s -w -X main.Version=$(VERSION)"
all: build
build:
$(foreach APP,$(APPS), CGO_ENABLED=0 go build -ldflags=$(FLAGS) -o $(BUILD_DIR)/$(APP) ./cmd/$(APP);)
clean:
rm -rf $(BUILD_DIR)/*
rm -rf $(TMP_DIR)/*
rm -rf *.out
lint:
golangci-lint run -v
prepare-test:
git submodule update --init --remote
test:
./scripts/prepare_test_repos.sh $(TMP_DIR)
go test -v ./...
ci-test:
./scripts/prepare_test_repos.sh $(TMP_DIR)
./scripts/run_foreach_test_repos.sh $(TMP_DIR) "sed -i '3i \ \ \"sandboxExecServer\": \"172.17.0.1:5051\",' conf.json"
GITHUB_ACTOR="" go test -v ./...