CI / Start
CI on TanStack Source
You want each push and each pull request tested, and no merge until the tests pass. Start with your first workflow, or find the task that you have now.
3 min read
How CI works on TanStack Source:
- A workflow is a TypeScript file in
.source/workflows/. - The forge runs each job of a workflow in a container of its own, in a fresh VM.
- Each run gets a trust level. The level decides which permissions and which CI environments, with their secret values, the jobs get.
- You can run the same job on your machine with
src ci run.
Start here
- Your first workflow: write a workflow, push it, and see a green check on a pull request.
- Run CI jobs on your machine: run a job as the forge runs it, and fix it without a push.
- Trust levels and secrets: what each trust level can do, and how jobs use secrets.
- Branch rules: block a merge until the required checks pass.
Make CI faster
- A slow step, like a build, runs in every job: Skip a slow step when its input files did not change.
- You want your jobs on other machines: Pick where jobs run: Ravion, the runner of the forge, or the machines of a runner app.
- A push to a pull request runs jobs that it does not affect: Skip jobs that nothing changed for with the
inputsof each job. - You want one required check for a whole workflow: Require all jobs with one check, with no container for that check.
- You keep the CI of many repositories: Share steps across repositories with
src:imports and one pinned version.
Show results on pull requests
- Reviewers search the comments for your results: Show results on a pull request gives each workflow a live card at the top of the pull request.
- A reviewer wants more work on a pull request: Start a workflow from a button lets a reviewer ask for it in one click.
- People want to try a fix before you release it: Publish package previews of a pull request. The packages of each pull request go on the forge. A card at the top of the pull request has an install line for each package.
- Someone asks you to try a fix: send them to Install a package preview.
When a check fails or waits
- A check failed, waits or never started: each job says why it ended or why it waits. A workflow that did not start shows a failed run with the reason and the fix. See When something on your pull request fails.
- You want an agent to fix a failed run: turn on the step Fix failing CI of the Keep green agent, in the software factory. It reproduces the failure, fixes the cause and pushes the fix.
- You opened a pull request from a fork: Pull requests from a fork says why your run waits, and what it can do.
- You work on a private pull request: its runs, logs, artifacts and checks show only to the people who can see it. See Work on a change in private.
Move from GitHub, or look something up
- You move from GitHub Actions: Move from GitHub Actions converts your YAML workflows.
- You look up an option, a limit or a command: see the CI reference. The npm package
@tanstack-source/cihas a short README.