> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paradime.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up Turbo CI

> Configure Turbo CI so every pull request builds and tests only your changed dbt™ models in a temporary schema, with the run status posted on the PR.

Turbo CI runs and tests only the dbt™ models you changed on each pull request, in a temporary schema, before they merge. This guide covers the shared setup (a dedicated CI environment, a schema macro, and a Turbo CI job), then points you to your git provider to finish.

<Note>
  **Prerequisites**

  * An [Admin role](/products/settings/users/role-based-access-control) in Paradime.
  * A production Bolt schedule to defer against (Turbo CI uses [state comparison](/products/bolt/ci-cd/index) to detect changes).
  * Admin access to your git provider (GitHub, GitLab, Azure DevOps, or BitBucket).

  Estimated time: 30 minutes.
</Note>

<Card title="Already running Turbo CI with --target ci?" href="/guides/migrations/migrate-turbo-ci-to-a-dedicated-environment" icon="arrow-right" horizontal>
  Follow the migration guide to move to a dedicated CI environment and drop the `--target ci` flags.
</Card>

## Steps

<Steps>
  <Step title="Create a dedicated CI environment">
    Turbo CI runs in its own Bolt environment so CI builds use a separate connection and target from production. In **Settings > Environments**, create a new environment (for example, `CI`), then add a warehouse connection to it with its **target name** set to `ci`. See [Create and manage environments](/guides/paradime-101/getting-started-with-your-paradime-workspace/setting-up-data-warehouse-connections).

    <Warning>
      Without a dedicated CI environment, Turbo CI would use your default environment's target, so the `ci` logic in the schema macro below never engages.
    </Warning>
  </Step>

  <Step title="Add a custom schema macro">
    So CI runs build into an isolated, temporary schema, add a `generate_schema_name.sql` macro to your project's `macros` folder. When the target is `ci`, models build into a schema prefixed `paradime_turbo_ci_pr_` (followed by the PR number):

    ```sql theme={"system"}
    {% macro generate_schema_name(custom_schema_name, node) -%}
        {%- set default_schema = target.schema -%}
        {%- if target.name == 'prod' -%}
            {{ custom_schema_name | trim }}
        {%- elif target.name == 'ci' -%}
            {{ default_schema }}
        {%- else -%}
            {%- if custom_schema_name is none -%}
                {{ default_schema }}
            {%- else -%}
                {{ default_schema }}_{{ custom_schema_name | trim }}
            {%- endif -%}
        {%- endif -%}
    {%- endmacro %}
    ```
  </Step>

  <Step title="Create the Turbo CI job">
    Create a Bolt schedule of type **Turbo CI**, with:

    * Its **Environment** set to the CI environment you created, so runs use the CI connection and `ci` target.
    * A production schedule to **defer** to, so state comparison knows what changed.
    * Commands that use the `state:modified+` selector to build and test only new and changed models, for example `dbt build --select state:modified+`. The environment supplies the `ci` target, so you do not append `--target ci`.
    * A trigger set to run when a pull request is opened.

    The [Test code changes on pull requests](/guides/orchestrate-data-pipelines/templates/ci-cd-templates/test-code-changes-on-pull-requests) template gives you a ready-made starting point.
  </Step>

  <Step title="Connect your git provider">
    Finish by wiring Turbo CI into your provider, which triggers the job on each PR and posts the status back:

    <CardGroup cols={2}>
      <Card title="GitHub" href="/products/bolt/ci-cd/turbo-ci/github" horizontal />

      <Card title="GitLab" href="/products/bolt/ci-cd/turbo-ci/gitlab" horizontal />

      <Card title="Azure DevOps" href="/products/bolt/ci-cd/turbo-ci/azure-devops" horizontal />

      <Card title="BitBucket" href="/products/bolt/ci-cd/turbo-ci/bitbucket" horizontal />
    </CardGroup>
  </Step>
</Steps>

<Check>
  Open a pull request that changes a model. Turbo CI runs, builds the changed models into a `paradime_turbo_ci_pr_<number>` schema, and the run status appears on the PR. On GitHub, a DinoAI summary is posted automatically if the run fails.
</Check>

## Next steps

<CardGroup cols={2}>
  <Card title="Turbo CI reference" href="/products/bolt/ci-cd/turbo-ci/index" icon="workflow">
    The full setup, environment variables, and schema cleanup.
  </Card>

  <Card title="Schedule types and triggers" href="/guides/paradime-101/running-dbt-in-production-with-bolt/understanding-schedule-types-and-triggers" icon="rocket">
    How the Turbo CI type and PR trigger fit together.
  </Card>
</CardGroup>


## Related topics

- [Set up continuous deployment](/guides/orchestrate-data-pipelines/set-up-continuous-deployment.md)
- [Create and manage environments](/guides/paradime-101/getting-started-with-your-paradime-workspace/setting-up-data-warehouse-connections.md)
- [Compare column-level lineage on pull requests](/guides/orchestrate-data-pipelines/compare-column-level-lineage.md)
- [Orchestrate your whole stack](/guides/orchestrate-data-pipelines/orchestrate-your-whole-stack.md)
- [Set up a GitHub merge queue with Paradime Turbo CI](/guides/working-with-git/github-merge-queue.md)
