# Build pipeline

> A continuous integration pipeline with a gate that sends failures back to the author. A Flowcharts example with its LaTeX source.

A Flowcharts example in the TeXeR TikZ library: https://texer.org/library/flowcharts/build-pipeline

Package: [Flowcharts](https://texer.org/library/flowcharts.md), on CTAN at https://ctan.org/pkg/pgf.

Tags: pipeline, CI, process, flowchart

## Source

```latex
\usetikzlibrary{shapes.geometric, arrows.meta, positioning}

\begin{tikzpicture}[
  node distance=6mm and 7mm,
  every node/.style={font=\small},
  stage/.style={rectangle, rounded corners, draw, minimum height=9mm, minimum width=16mm},
  gate/.style={diamond, aspect=1.6, draw, inner sep=1pt},
  arrow/.style={-{Stealth}, thick},
]
  \node[stage] (commit) {Commit};
  \node[stage, right=of commit] (build) {Build};
  \node[gate, right=of build] (test) {Tests pass?};
  \node[stage, right=of test] (deploy) {Deploy};
  \node[stage, below=10mm of test] (notify) {Notify the author};

  \draw[arrow] (commit) -- (build);
  \draw[arrow] (build) -- (test);
  \draw[arrow] (test) -- node[above] {yes} (deploy);
  \draw[arrow] (test) -- node[right] {no} (notify);
  \draw[arrow] (notify) -| (commit);
\end{tikzpicture}
```

## As a complete document

The same example in a document that compiles on its own with pdfLaTeX:

```latex
\documentclass[margin=3mm]{standalone}
\usepackage{tikz}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{amssymb}
\usetikzlibrary{shapes.geometric, arrows.meta, positioning}

\begin{document}

\begin{tikzpicture}[
  node distance=6mm and 7mm,
  every node/.style={font=\small},
  stage/.style={rectangle, rounded corners, draw, minimum height=9mm, minimum width=16mm},
  gate/.style={diamond, aspect=1.6, draw, inner sep=1pt},
  arrow/.style={-{Stealth}, thick},
]
  \node[stage] (commit) {Commit};
  \node[stage, right=of commit] (build) {Build};
  \node[gate, right=of build] (test) {Tests pass?};
  \node[stage, right=of test] (deploy) {Deploy};
  \node[stage, below=10mm of test] (notify) {Notify the author};

  \draw[arrow] (commit) -- (build);
  \draw[arrow] (build) -- (test);
  \draw[arrow] (test) -- node[above] {yes} (deploy);
  \draw[arrow] (test) -- node[right] {no} (notify);
  \draw[arrow] (notify) -| (commit);
\end{tikzpicture}
\end{document}
```
