aboutsummaryrefslogtreecommitdiffstats
path: root/guide/ci.html
blob: 998c3cf6227b49311d0368a2d42c9599d0740dea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<title>Erlang.mk User Guide</title>
<style type="text/css"><!--
body{background:white;color:black;font-family:"Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;justify-content:center;margin:0 auto;padding:0;width:600px}
header {align-items:center;display:flex;justify-content:center}
header nav.left{text-align:right;width:150px}
header nav.right{text-align:left;width:150px}
header nav a{display:block;margin:1.5em 1em}
main{margin-top:2em;text-align:justify}
main h2, main h3{margin-top:2em}
main h1, main div.chapter>div.titlepage h2{font-size:2em;margin-top:.67em}
a{color:#d9230f;text-decoration:none}
a:hover{text-decoration:underline}
a.xref{display:none}
h1, h2, h3{font-weight:normal}
div.navfooter{margin-bottom:1em}
--></style>
</head>
<body>
<header>
	<nav class="left">
		<a href="index.html">User guide</a>
		<a href="getting_started.html">Tutorials</a>
	</nav>
	<a href="/" class="logo"><img src="../res/logo-small.png" alt="Erlang.mk" title="Erlang.mk: A build tool for Erlang that just works" height="200" width="206"/></a>
	<nav class="right">
		<a href="https://github.com/ninenines/erlang.mk/tree/master/index">470+ packages</a>
		<a href="https://github.com/ninenines/erlang.mk/issues">Issues?</a>
	</nav>
</header>
<main>

<div class="navheader"><table width="100%" summary="Navigation header"><tr><td width="20%" align="left"><a accesskey="p" href="coverage.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="dialyzer.html">Next</a></td></tr></table><hr /></div><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="ci"></a>Chapter 22. Continuous integration</h2></div></div></div><p>Erlang.mk comes with some support for continuous integration,
aimed at open source projects that need to support more than
one specific Erlang/OTP release. (If you target one specific
release, check the <a class="link" href="kerl.html#otp_version_pinning" title="12.2. OTP version pinning">OTP version pinning</a>
section of the <a class="link" href="kerl.html" title="Chapter 12. OTP version management">OTP version management</a> chapter.)</p><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_configuring_erlang_otp_versions_to_test"></a>22.1. Configuring Erlang/OTP versions to test</h2></div></div></div><p>To use the CI plugin you must first configure which versions
of Erlang/OTP will be used. Erlang.mk provides three separate
configuration variables depending on whether you need a normal
OTP release, a HiPE-enabled release or an ErLLVM-enabled release.</p><p>At the time of writing, this is how you would test against all
the most recent patch releases of Erlang/OTP 19 and above:</p><pre class="programlisting">CI_OTP = OTP-19.0.7 OTP-19.1.6 OTP-19.2.3 OTP-19.3.6.2 OTP-20.0.4</pre><p>If you want to test against HiPE and ErLLVM but only with the
latest version of Erlang/OTP, the following could work:</p><pre class="programlisting">CI_HIPE = $(lastword $(CI_OTP))
CI_ERLLVM = $(CI_HIPE)</pre><p>Consult the <a class="link" href="kerl.html" title="Chapter 12. OTP version management">OTP version management</a> chapter for more
information about Erlang/OTP versions and customization of the
Erlang/OTP builds.</p></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_running_tests_across_all_configured_versions"></a>22.2. Running tests across all configured versions</h2></div></div></div><p>The recommended way to run the <code class="literal">ci</code> target is with the option
<code class="literal">-k</code>. It will ensure that tests are run for all configured
Erlang/OTP versions, even if there are errors:</p><pre class="programlisting">$ make ci -k</pre></div><div class="section"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="_extending_the_ci_targets"></a>22.3. Extending the CI targets</h2></div></div></div><p>The <code class="literal">ci</code> target can be extended. For example to run Dialyzer
at the end of CI:</p><pre class="programlisting">ci:: dialyze</pre><p>Additional setup can be done by extending the <code class="literal">ci-setup</code>
target. This target is ran before testing each individual
Erlang/OTP version.</p><p>For example, to ensure dependencies are re-fetched/built
before testing individual Erlang/OTP releases:</p><pre class="programlisting">ci-setup:: distclean</pre><p>Similarly, the <code class="literal">ci-extra</code> target can be extended to run
extra commands after an Erlang/OTP version has been tested.</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="coverage.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="tests.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="dialyzer.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> </td></tr></table></div>
</main>
</body>
</html>