chore: update test workflow
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
张泊明518370910136 2024-06-15 04:26:18 -04:00
parent d46cebb906
commit 2ac4d5f8e9
GPG Key ID: D47306D7062CDA9D
2 changed files with 8 additions and 4 deletions

View File

@ -1,19 +1,23 @@
.PHONY: all clean test
.PHONY: all build clean prepare-test test
BUILD_DIR = ./build
TMP_DIR = ./tmp
APPS := $(notdir $(wildcard ./cmd/*))
FLAGS := "-s -w"
all:
all: build
build:
$(foreach APP,$(APPS), go build -ldflags=$(FLAGS) -o $(BUILD_DIR)/$(APP) ./cmd/$(APP);)
clean:
rm -rf $(BUILD_DIR)/*
rm -rf $(TMP_DIR)/*
rm -rf *.out
prepare-test:
git submodule update --init --remote
test:
./scripts/prepare_test_repos.sh
./scripts/prepare_test_repos.sh $(TMP_DIR)
go test -coverprofile cover.out -v ./...

View File

@ -2,7 +2,7 @@
set -ex
declare -A repo_names
tmp_dir="./tmp"
tmp_dir=${1:-./tmp}
submodules_dir="$tmp_dir/submodules"
rm -rf $submodules_dir
mkdir -p $submodules_dir