我尝试为构建矩阵的每个元素运行两个阶段,test_it
和package_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"