构建阶段:预热缓存

此示例有 2 个构建阶段

  • 一个作业安装依赖项并为给定分支预热缓存。
  • 三个作业运行测试,使用缓存。

以下是 .travis.yml 配置可能的样子

cache: bundler

jobs:
  include:
    - stage: prepare cache
      script: true
      rvm: 2.3
    - stage: test
      script: bundle show
      rvm: 2.3
    - stage: test
      script: bundle show
      rvm: 2.3
    - stage: test
      script: bundle show
      rvm: 2.3

构建矩阵可能如下所示

image

您可以在我们的 演示存储库 上找到此示例的代码。