2018-04-28 22:05:30 +02:00
|
|
|
PROJECT_NAME := Pulumi SDK
|
2018-06-10 01:16:35 +02:00
|
|
|
SUB_PROJECTS := sdk/nodejs sdk/python sdk/go
|
2017-11-12 01:20:56 +01:00
|
|
|
include build/common.mk
|
2017-06-21 23:23:48 +02:00
|
|
|
|
2017-12-05 22:39:13 +01:00
|
|
|
PROJECT := github.com/pulumi/pulumi
|
|
|
|
PROJECT_PKGS := $(shell go list ./cmd/... ./pkg/... | grep -v /vendor/)
|
|
|
|
EXTRA_TEST_PKGS := $(shell go list ./examples/ ./tests/... | grep -v /vendor/)
|
2018-03-16 01:07:01 +01:00
|
|
|
VERSION := $(shell scripts/get-version)
|
2016-11-15 20:30:34 +01:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
GOMETALINTERBIN := gometalinter
|
|
|
|
GOMETALINTER := ${GOMETALINTERBIN} --config=Gometalinter.json
|
2017-06-21 23:46:03 +02:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
TESTPARALLELISM := 10
|
2018-01-24 00:56:58 +01:00
|
|
|
|
|
|
|
# Our travis workers are a little show and sometime the fast tests take a little longer
|
|
|
|
ifeq ($(TRAVIS),true)
|
|
|
|
TEST_FAST_TIMEOUT := 10m
|
|
|
|
else
|
2017-12-15 21:12:06 +01:00
|
|
|
TEST_FAST_TIMEOUT := 2m
|
2018-01-24 00:56:58 +01:00
|
|
|
endif
|
2017-06-16 18:50:56 +02:00
|
|
|
|
2018-07-12 22:29:35 +02:00
|
|
|
build-proto::
|
|
|
|
cd sdk/proto && ./generate.sh
|
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
build::
|
2017-12-01 22:50:32 +01:00
|
|
|
go install -ldflags "-X github.com/pulumi/pulumi/pkg/version.Version=${VERSION}" ${PROJECT}
|
2017-01-28 00:42:55 +01:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
install::
|
2017-12-01 22:50:32 +01:00
|
|
|
GOBIN=$(PULUMI_BIN) go install -ldflags "-X github.com/pulumi/pulumi/pkg/version.Version=${VERSION}" ${PROJECT}
|
2017-10-05 23:08:35 +02:00
|
|
|
|
2018-08-08 22:00:42 +02:00
|
|
|
dist::
|
|
|
|
go install -ldflags "-X github.com/pulumi/pulumi/pkg/version.Version=${VERSION}" ${PROJECT}
|
|
|
|
|
2017-11-01 00:39:23 +01:00
|
|
|
LINT_SUPPRESS="or be unexported"
|
2017-11-12 01:20:56 +01:00
|
|
|
lint::
|
2017-09-22 04:18:21 +02:00
|
|
|
$(GOMETALINTER) main.go | grep -vE ${LINT_SUPPRESS} | sort ; exit $$(($${PIPESTATUS[1]}-1))
|
Tidy up more lint
This change fixes a few things:
* Most importantly, we need to place a leading "." in the paths
to Gometalinter, otherwise some sub-linters just silently skip
the directory altogether. errcheck is one such linter, which
is a very important one!
* Use an explicit Gometalinter.json file to configure the various
settings. This flips on a few additional linters that aren't
on by default (line line length checking). Sadly, a few that
I'd like to enable take waaaay too much time, so in the future
we may consider a nightly job (this includes code similarity,
unused parameters, unused functions, and others that generally
require global analysis).
* Now that we're running more, however, linting takes a while!
The core Lumi project now takes 26 seconds to lint on my laptop.
That's not terrible, but it's long enough that we don't want to
do the silly "run them twice" thing our Makefiles were previously
doing. Instead, we shall deploy some $$($${PIPESTATUS[1]}-1))-fu
to rely on the fact that grep returns 1 on "zero lines".
* Finally, fix the many issues that this turned up.
I think(?) we are done, except, of course, for needing to drive
down some of the cyclomatic complexity issues (which I'm possibly
going to punt on; see pulumi/lumi#259 for more details).
2017-06-22 21:09:46 +02:00
|
|
|
$(GOMETALINTER) ./pkg/... | grep -vE ${LINT_SUPPRESS} | sort ; exit $$(($${PIPESTATUS[1]}-1))
|
2017-09-22 04:18:21 +02:00
|
|
|
$(GOMETALINTER) ./cmd/... | grep -vE ${LINT_SUPPRESS} | sort ; exit $$(($${PIPESTATUS[1]}-1))
|
2017-01-28 00:42:55 +01:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
test_fast::
|
2017-12-15 21:12:06 +01:00
|
|
|
go test -timeout $(TEST_FAST_TIMEOUT) -cover -parallel ${TESTPARALLELISM} ${PROJECT_PKGS}
|
2017-08-06 17:52:32 +02:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
test_all::
|
2017-12-05 22:39:13 +01:00
|
|
|
PATH=$(PULUMI_ROOT)/bin:$(PATH) go test -cover -parallel ${TESTPARALLELISM} ${EXTRA_TEST_PKGS}
|
Makeify more; add a "full build" target (#193)
* Makeify more; add a "full build" target
This change uses make for more of our tree. Namely, the AWS provider
and LumiJS compilers each now use make to build and/or install them.
Not only does this bring about some consistency to how we build and
test things, but also made it easy to add a full build target:
$ make all
This target will build, test, and install the core Go tools, the LumiJS
compiler, and the AWS provider, in that order.
Each can be made in isolation, however, which ensures that the inner
loop for those is fast and so that, when it comes to finishing
pulumi/lumi#147, we can easily split them out and make from the top.
2017-06-02 23:26:34 +02:00
|
|
|
|
2018-03-06 23:36:50 +01:00
|
|
|
.PHONY: publish_tgz
|
|
|
|
publish_tgz:
|
2017-11-12 01:20:56 +01:00
|
|
|
$(call STEP_MESSAGE)
|
2018-03-06 23:36:50 +01:00
|
|
|
./scripts/publish_tgz.sh
|
|
|
|
|
|
|
|
.PHONY: publish_packages
|
|
|
|
publish_packages:
|
|
|
|
$(call STEP_MESSAGE)
|
|
|
|
./scripts/publish_packages.sh
|
2016-11-15 20:30:34 +01:00
|
|
|
|
2017-11-12 01:20:56 +01:00
|
|
|
.PHONY: coverage
|
|
|
|
coverage:
|
|
|
|
$(call STEP_MESSAGE)
|
2017-11-20 20:12:04 +01:00
|
|
|
./scripts/gocover.sh
|
2017-06-24 00:11:20 +02:00
|
|
|
|
2017-09-28 20:53:08 +02:00
|
|
|
# The travis_* targets are entrypoints for CI.
|
2017-11-12 01:20:56 +01:00
|
|
|
.PHONY: travis_cron travis_push travis_pull_request travis_api
|
|
|
|
travis_cron: all coverage
|
2018-03-06 23:36:50 +01:00
|
|
|
travis_push: only_build publish_tgz only_test publish_packages
|
2017-09-28 20:53:08 +02:00
|
|
|
travis_pull_request: all
|
|
|
|
travis_api: all
|