ci.asciidoc 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. [[ci]]
  2. == Continuous integration
  3. Erlang.mk comes with some support for continuous integration,
  4. aimed at open source projects that need to support more than
  5. one specific Erlang/OTP release. (If you target one specific
  6. release, check the xref:otp_version_pinning[OTP version pinning]
  7. section of the xref:kerl[OTP version management] chapter.)
  8. === Configuring Erlang/OTP versions to test
  9. To use the CI plugin you must first configure which versions
  10. of Erlang/OTP will be used.
  11. At the time of writing, this is how you would test against all
  12. the most recent patch releases of Erlang/OTP 19 and above:
  13. [source,make]
  14. CI_OTP = OTP-19.0.7 OTP-19.1.6 OTP-19.2.3 OTP-19.3.6.2 OTP-20.0.4
  15. Consult the xref:kerl[OTP version management] chapter for more
  16. information about Erlang/OTP versions and customization of the
  17. Erlang/OTP builds.
  18. === Running tests across all configured versions
  19. The recommended way to run the `ci` target is with the option
  20. `-k`. It will ensure that tests are run for all configured
  21. Erlang/OTP versions, even if there are errors:
  22. [source,bash]
  23. $ make ci -k
  24. === Extending the CI targets
  25. The `ci` target can be extended. For example to run Dialyzer
  26. at the end of CI:
  27. [source,make]
  28. ----
  29. ci:: dialyze
  30. ----
  31. Additional setup can be done by extending the `ci-setup`
  32. target. This target is ran before testing each individual
  33. Erlang/OTP version.
  34. For example, to ensure dependencies are re-fetched/built
  35. before testing individual Erlang/OTP releases:
  36. [source,make]
  37. ----
  38. ci-setup:: distclean
  39. ----
  40. Similarly, the `ci-extra` target can be extended to run
  41. extra commands after an Erlang/OTP version has been tested.