JOJ3/Makefile
张泊明518370910136 2d4c7c30a3
All checks were successful
build / build (push) Successful in 1m6s
build / trigger-build-image (push) Successful in 7s
refactor(cmd/joj3): conf (#51)
Reviewed-on: #51
Co-authored-by: Boming Zhang <bomingzh@sjtu.edu.cn>
Co-committed-by: Boming Zhang <bomingzh@sjtu.edu.cn>
2024-10-12 13:21:58 +08:00

34 lines
861 B
Makefile

.PHONY: all build clean lint prepare-test test ci-test
BUILD_DIR = ./build
TMP_DIR = ./tmp
APPS := $(notdir $(wildcard ./cmd/*))
VERSION := $(shell git rev-parse --short HEAD)
FLAGS := "-s -w -X main.Version=$(VERSION)"
all: build
build:
$(foreach APP,$(APPS), go build -ldflags=$(FLAGS) -o $(BUILD_DIR)/$(APP) ./cmd/$(APP);)
cp ./build/repo-health-checker ./build/healthcheck
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 -coverprofile cover.out -v ./...
ci-test:
./scripts/prepare_test_repos.sh $(TMP_DIR)
./scripts/run_foreach_test_repos.sh $(TMP_DIR) "sed -i '2i \ \ \"sandboxExecServer\": \"172.17.0.1:5051\",' conf.json"
GITHUB_ACTIONS="test" go test -coverprofile cover.out -v ./...