travis-ci每个矩阵元素的多个构建阶段

时间:2018-08-06 06:15:13

标签: travis-ci

我尝试为构建矩阵的每个元素运行两个阶段,test_itpackage_it。如果test_it阶段中的所有作业都通过了,那么我想完成所有package_it的作业。

我有一个.travis.yml文件,该文件可以执行我想要的操作,但冗长且重复。获得相同效果的最佳方法是什么?

sudo: false

language: cpp

cache:
  ccache: true

jobs:
  include:
    - stage: test_it
      os: linux
      dist: trusty
      compiler: gcc
      addons:
        apt:
          packages:
            - bash-completion
            - curl
      script: echo "test_it on $TRAVIS_OS_NAME"
    - stage: test_it
      os: osx
      compiler: clang
      script: echo "test_it on $TRAVIS_OS_NAME"
    - stage: package_it
      os: linux
      dist: trusty
      compiler: gcc
      addons:
        apt:
          packages:
            - bash-completion
            - curl
      script: echo "package_it on $TRAVIS_OS_NAME"
    - stage: package_it
      os: osx
      compiler: clang
      script: echo "package_it on $TRAVIS_OS_NAME"

0 个答案:

没有答案