持续集成

Turborepo 不仅可以加快构建速度,还可以通过使用 远程缓存 加快其余的持续集成流水线。以下是一些平台秘诀,用于将 Turborepo 与你的 CI 提供商一起使用。

¥Turborepo not only speeds up builds, but also the rest of your Continuous Integration pipeline by using Remote Caching. Below are a few platform recipes to use Turborepo with your CI providers.

常规设置

¥General Setup

要为你的 CI 启用远程缓存:

¥To enable Remote Caching for your CI:

  1. 在你的 CI 中设置 Turborepo 的环境变量以访问你的远程缓存。

    ¥Setup the environment variables for Turborepo in your CI to access your Remote Cache.

    变量描述
    TURBO_TOKEN用于访问远程缓存的 Bearer 令牌
    TURBO_TEAM与你的仓库关联的账户名。使用 Vercel Remote Cache 时,此变量设置为 你团队的 slug
  2. 克隆你的仓库。

    ¥Clone your repository.

  3. 通过包管理器安装你的依赖。

    ¥Install your dependencies through your package manager.

  4. 通过 turbo 运行你的任务。

    ¥Run your tasks through turbo.