> ## 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.

# Turbo CI on GitLab merge requests

> Trigger a Paradime Turbo CI Bolt schedule from a GitLab pipeline to build and test only the dbt™ models changed in a merge request before it lands.

export const Arcade = ({src, title}) => <div style={{
  position: 'relative',
  paddingBottom: 'calc(56.2225% + 41px)',
  height: 0,
  width: '100%'
}}>
    <iframe src={src} title={title} frameBorder="0" loading="lazy" allow="clipboard-write" allowFullScreen style={{
  position: 'absolute',
  top: 0,
  left: 0,
  width: '100%',
  height: '100%',
  colorScheme: 'light'
}} />
  </div>;

Run Turbo CI on GitLab pull requests. First complete the shared [Turbo CI setup](/products/bolt/ci-cd/turbo-ci/index) — the `ci` environment, the custom schema macro, and the Turbo CI job — then wire up your GitLab pipeline.

<Warning>
  GitLab merged results pipelines require the **Premium** or **Ultimate** tier. [Enable merged results pipelines](https://docs.gitlab.com/ee/ci/pipelines/merged_results_pipelines.html#enable-merged-results-pipelines) before continuing.
</Warning>

## Generate API keys

To trigger the Turbo CI schedule from your pipeline, generate a Paradime [API key](/developers/api-keys) with the **Bolt schedules admin** capability. Generate an **Account API key** (a `prdm_cmp_...` Bearer token) and save the token, your **workspace token**, and the **API endpoint**; you will add them as CI/CD variables in the next step.

<Card title="Generate API keys" href="/developers/api-keys" horizontal icon="arrow-right" />

## Create a GitLab pipeline

Create a `.gitlab-ci.yml` file at the root of your dbt™ repository and enter the values required.

```yaml title=".gitlab-ci.yml" lineNumbers theme={"system"}
# Define the stages of the pipeline - in this case, just one stage for CI
stages:
 - paradime_turbo_ci

# Main job definition
paradime_turbo_ci:
  # Specify which stage this job belongs to
  stage: paradime_turbo_ci

  # Use Python 3.11 as the base Docker image for this job
  image: python:3.11

  # Define when this pipeline should be triggered
  rules:
    # This job will run when a merge request event occurs (MR opened or updated)
    - if: $CI_PIPELINE_SOURCE == "merge_request_event"
      when: always

  # Define environment variables needed for the job
  variables:
    # These variables should be configured in GitLab CI/CD settings
    PARADIME_WORKSPACE_UID: ${PARADIME_WORKSPACE_UID}           # Workspace token (workspace UID)
    PARADIME_API_SECRET: ${PARADIME_API_SECRET}     # Account API key (prdm_cmp_...)
    PARADIME_API_ENDPOINT: ${PARADIME_API_ENDPOINT} # Paradime API endpoint URL
    PARADIME_SCHEDULE_SLUG: "flowing-pachy-wyy4fs"  # Slug of the Paradime schedule to run
  before_script:
    # Install the Paradime Python SDK
    - pip install paradime-io

  script:
    # Get the merge request number and commit SHA from GitLab predefined variables
    - export MR_NUMBER=$CI_MERGE_REQUEST_IID
    - echo "Merge Request Number: $MR_NUMBER"
    - echo "Commit SHA: $CI_COMMIT_SHA"
    # Run the Turbo CI schedule for this PR and wait for completion
    - paradime bolt run "$PARADIME_SCHEDULE_SLUG" --branch ${CI_COMMIT_SHA} --pr-number $MR_NUMBER --wait

  timeout: 60 minutes
```

## Add the variables in GitLab

Add these as GitLab CI/CD variables:

* `PARADIME_API_SECRET` — your account API key (`prdm_cmp_...`)
* `PARADIME_WORKSPACE_UID` — your workspace token
* `PARADIME_API_ENDPOINT`

<Arcade src="https://demo.arcade.software/UcTn34OhEg5OwXDVOKVu?embed&embed_mobile=tab&embed_desktop=inline&show_copy_link=true" title="GitLab" />

## View run logs

Inspect the run logs for each Turbo CI run like any other Bolt schedule.

<Card title="Run details" href="/products/bolt/managing-schedules/run-details" horizontal icon="arrow-right" />


## Related topics

- [Turbo CI on GitHub pull requests](/products/bolt/ci-cd/turbo-ci/github.md)
- [Column-Level Lineage Diff on GitLab](/products/bolt/ci-cd/lineage-diff/gitlab.md)
- [Turbo CI for dbt™ pull requests](/products/bolt/ci-cd/turbo-ci/index.md)
- [Bolt CI/CD for dbt™ pull requests and deploys](/products/bolt/ci-cd/index.md)
- [GitLab](/integrations/gitlab.md)
