uber-go / cadence-client

Framework for authoring workflows and activities running on top of the Cadence orchestration engine.
https://cadenceworkflow.io
MIT License
344 stars 130 forks source link

Modernize makefile, to make it stable like github.com/uber/cadence #1155

Closed Groxx closed 2 years ago

Groxx commented 2 years ago

Builds now work reliably, even in parallel, and it recovers from previous builds (whether successful or not) without running more than necessary.

We should switch to revive and goimports like the server does, and ideally both will move to go test ./... eventually (with build tags or something to exclude integration tests) to make the tests run more normally. We can also take advantage of Go's built-in coverage merging and reports that way.

But those are for another day. This is just setting a saner foundation.


At a very high level, this brings the client's makefile in line with the server's, and adds make build and make all targets for dev-simplicity (and visibility). These targets will do a full build / lint only when necessary, i.e. after changes have been made. They should be more than sufficient for most uses, as they now ensure thrift/fmt/copyright headers consistently, but you can run make lint to get the output again if desired, and some stages can be run independently without running later ones (like fmt).

To see current top-level targets, just run make. It'll print help output:

❯ make
help                 Prints a help message showing any specially-commented targets
all                  refresh codegen, lint, and ensure the dummy binary builds, if necessary
build                ensure all packages build
copyright            update copyright headers
deps                 Check for dependency updates, for things that are directly imported
deps-all             Check for all dependency updates
errcheck             (re)run errcheck
fmt                  run gofmt
lint                 (re)run golint
staticcheck          (re)run staticcheck
test                 run all tests (requires a running cadence instance)
unit_test            run all unit tests
coveralls commented 2 years ago

Pull Request Test Coverage Report for Build 197f8635-2a13-4ce2-a265-272e7212070e


Files with Coverage Reduction New Missed Lines %
internal/compatibility/proto/enum.go 5 18.98%
internal/compatibility/thrift/types.go 5 44.9%
internal/compatibility/proto/types.go 12 21.08%
<!-- Total: 22 -->
Totals Coverage Status
Change from base Build 27a5a12e-f930-4df7-a1ba-389c8c4dbb1d: -0.06%
Covered Lines: 12362
Relevant Lines: 19363

💛 - Coveralls