Distributed Builds and Distributed CI
Nx uses computation caching and code change analysis (
affected:* commands) to limit the number of things that have to be rebuilt and retested. This can drastically reduce the average CI time.
But regardless of how smart Nx is, there will be some large changes affecting the whole codebase. The only way to keep those fast as your repository keeps growing is to build and test them using multiple machines/agents.
There are several ways to distribute your CI across multiple machines.
But you can also set up distribution manually using the
Please look at the following two examples:
- Example of setting up distributed Azure build for Nx workspace
- Example of setting up distributed Jenkins build for Nx workspace
The Azure example is very easy to port to other CI providers (e.g., CircleCI, GitLab).
Read Distributing CI: Binning and Distributed Task Execution to learn about the two approaches.