diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bd0ec5a..748a26f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,11 +15,8 @@ jobs: with: go-version: '^1.19' - - name: Format - run: make fmt - - name: Build - run: make build + run: make - uses: actions/upload-artifact@v3 if: ${{ github.event_name == 'push' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) }} diff --git a/Makefile b/Makefile index 0685a05..e57a522 100644 --- a/Makefile +++ b/Makefile @@ -1,19 +1,16 @@ -.PHONY: build -build: - go build \ - -trimpath \ - -buildmode=pie \ - -ldflags "-s -w" \ - . +FLAGS=-ldflags "-s -w" -.PHONY: test -test: - go test -v ./... +.PHONY: all +all: clean fmt build + +.PHONY: clean +clean: + go clean .PHONY: fmt fmt: gofmt -d -e -s . -.PHONY: clean -clean: - go clean +.PHONY: build +build: + go build $(FLAGS)