如何让 TravisCI 并行运行 flow/test/lint? [英] How to make TravisCI run flow/test/lint in parallel?
问题描述
在我的 .travis.yml
中,我有这个.
In my .travis.yml
I have this.
script:
- yarn lint
- yarn flow
- yarn test --runInBand
我想知道有没有办法让它们并行运行?
I was wondering is there a way to get them to run in parallel?
推荐答案
Travis 文档中提供了一些您可以使用的建议,即将您的构建拆分为多个作业:https://docs.travis-ci.com/user/speeding-up-the-build/
There's few suggestions in Travis docs you could use, i.e. split your build into multiple jobs: https://docs.travis-ci.com/user/speeding-up-the-build/
您可以做的另一件事是使用 GNU 并行:
Another thing you could do is to employ GNU parallel:
addons:
apt_packages:
- parallel
script:
- parallel --gnu --keep-order ::: 'yarn lint' 'yarn flow' 'yarn test --runInBand'
GNU 并行命令有许多选项,您可能需要根据需要进行调整.在他们的网站上阅读有关该工具的更多信息 https://www.gnu.org/software/parallel/
The GNU parallel command has lots of options you might want to tweak to your needs. Read more about the tool on their website https://www.gnu.org/software/parallel/
这篇关于如何让 TravisCI 并行运行 flow/test/lint?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!