Skip to content
Source
Sign inSign up
TanStack/config
Open History to see the last commit

ci-cd.md

30 lines1.3 KB

1---
2id: ci-cd
3title: CI/CD
4---
5​
6## GitHub Workflows
7​
8- `pr.yml`:
9 - Runs tests for all pull requests
10 - Runs `nx affected`, which only executes tasks with invalidated cache
11 - Also uses `pkg-pr-new` to publish package previews and create links to our examples
12- `release.yml`:
13 - Runs tests for code merged into release branches
14 - Runs `nx run-many`, which executes all tasks and ensures the outputs are present (necessary for publishing builds)
15 - Uses [Changesets](https://github.com/changesets/changesets) to handle versioning and publishing
16​
17## Nx
18​
19The TanStack projects use Nx to enable rapid execution of our tests and builds. Tasks are parallelised and cached both locally and in CI. While Nx has an extensive plugin system, we only utilise Nx as an NPM script runner.
20​
21### Config Files
22​
23- `./nx.json`: Main config file, which defines task dependencies, inputs, and outputs
24- `./package.json`: Need to manually specify root-level scripts (e.g. `test:format`)
25- `./**/package.json`: Package-level scripts (e.g. `build`) are automatically detected
26​
27### Nx Agents
28​
29- Nx allows you to distribute your tasks across multiple CI machines, increasing the number of jobs that can be run in parallel
30- Please note that this does incur quite a significant startup delay