【问题标题】:How can I build master against only stable Rust on Travis CI?如何在 Travis CI 上仅针对稳定的 Rust 构建 master?
【发布时间】:2018-08-01 01:09:38
【问题描述】:

我目前针对stablebeta 构建了一个Rust 应用程序。分支调试构建相当快 - 5 分钟 - 但发布构建可以达到 45 分钟。我目前有两个同时工作的付费 Travis 计划。针对稳定版和测试版构建意味着在 45 分钟内没有其他 CI 作业执行。

我只关心来自 stable 作业的构建工件。如何从主构建和标记构建中排除 beta

我的 .travis.yml:

sudo: false
language: rust
rust:
- stable
- beta

matrix:
  fast_finish: true
  allow_failures:
    rust:
    - beta

cache:
  cargo: true
  timeout: 600

script:
- make pkginfo
- make test

我认为我需要对 matrix 进行修改,但 Build Matrix 文档并不清楚如何执行此操作。

【问题讨论】:

    标签: rust travis-ci


    【解决方案1】:

    您可以将rust 工具链定义单独移动到构建矩阵和specify which branches to build 中。借助分支黑名单和捕获标记提交的正则表达式(假设格式为v#.#.#),我们得到以下信息:

    sudo: false
    language: rust
    
    matrix:
      fast_finish: true
      include:
      - rust: stable
      - rust: beta
        branches:
        except:
        - master
        - /^v\d+\.\d+(\.\d+)?(-\S*)?$/
      allow_failures:
        rust:
        - beta
    
    cache:
      cargo: true
      timeout: 600
    
    script:
    - make pkginfo
    - make test
    

    【讨论】:

    猜你喜欢
    • 2018-03-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-12-14
    • 2020-09-04
    • 1970-01-01
    相关资源
    最近更新 更多