diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 42f126d..fa6ab86 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,8 +19,8 @@ jobs: with: go-version: '1.21' - run: go version - - run: make clean ; go generate ./... ; go build -o build/ ./cmd/... - - run: go test -race -cover -covermode=atomic -coverprofile=coverage.out ./... + - run: make clean + - run: make - run: ./build/pathctl -version - uses: codecov/codecov-action@v3 with: diff --git a/.gitignore b/.gitignore index 3985f77..1a98199 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ generate-stamp .DS_Store .envrc +version.txt diff --git a/Makefile b/Makefile index dfecf83..123e0fc 100644 --- a/Makefile +++ b/Makefile @@ -31,11 +31,11 @@ ifdef verbose VERBOSE = -v endif -all: generate build check +all: version.txt build check BUILD_TARGETS := build install -build: generate +build: version.txt build: BUILD_ARGS=-o $(BUILDDIR)/ $(BUILD_TARGETS): $(BUILDDIR)/ @@ -55,10 +55,8 @@ go.sum: go.mod go mod tidy touch $@ -generate: generate-stamp -generate-stamp: go.sum +generate: go generate ./... - touch $@ distclean: clean rm -rf dist/ @@ -68,10 +66,10 @@ clean: rm -rf $(BUILDDIR) rm -f \ $(COVERAGE_REPORT_FILENAME) \ - generate-stamp version-stamp + version.txt -version-stamp: generate - cp internal/version/version.txt $@ +version.txt: generate + cp -f version/version.txt version.txt list: @echo $(BINS) | tr ' ' '\n'