ci.mk 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright (c) 2015-2017, Loïc Hoguin <essen@ninenines.eu>
  2. # This file is part of erlang.mk and subject to the terms of the ISC License.
  3. .PHONY: ci ci-prepare ci-setup
  4. CI_OTP ?=
  5. ifeq ($(strip $(CI_OTP)),)
  6. ci::
  7. else
  8. ci:: $(addprefix ci-,$(CI_OTP))
  9. ci-prepare: $(addprefix $(KERL_INSTALL_DIR)/,$(CI_OTP))
  10. ci-setup::
  11. $(verbose) :
  12. ci-extra::
  13. $(verbose) :
  14. ci_verbose_0 = @echo " CI " $(1);
  15. ci_verbose = $(ci_verbose_$(V))
  16. define ci_target
  17. ci-$1: $(KERL_INSTALL_DIR)/$2
  18. $(verbose) $(MAKE) --no-print-directory clean
  19. $(ci_verbose) \
  20. PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \
  21. CI_OTP_RELEASE="$1" \
  22. CT_OPTS="-label $1" \
  23. CI_VM="$3" \
  24. $(MAKE) ci-setup tests
  25. $(verbose) $(MAKE) --no-print-directory ci-extra
  26. endef
  27. $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp)))
  28. $(foreach otp,$(filter-out $(ERLANG_OTP),$(CI_OTP)),$(eval $(call kerl_otp_target,$(otp))))
  29. help::
  30. $(verbose) printf "%s\n" "" \
  31. "Continuous Integration targets:" \
  32. " ci Run '$(MAKE) tests' on all configured Erlang versions." \
  33. "" \
  34. "The CI_OTP variable must be defined with the Erlang versions" \
  35. "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3"
  36. endif