GitHub and Travis CI - How to fail build when tests fail

二次信任 提交于 2020-01-01 19:07:46

问题


I have a Scala project on GitHub and I use the Travis CI to build it and show the resulting badge on the project home in GitHub. I started to write unit tests and I realized that during one of my commit, some tests failed. But the travis build shows that the build passes.

I know that I should be using some kind of hook to check for tests failures and correspondingly fail my build. But I just don't know what the correct command for that is? I could not as well infer this from any documentation.

Here is my travis.yml file:

language: scala

jdk:
  - oraclejdk8

scala:
  - 2.11.7

script:
  - sbt clean coverage test coverageReport

after_success:
  - bash <(curl -s https://codecov.io/bash)

What hook should I add here so that the build fails as soon as one of my unit test fails?

来源:https://stackoverflow.com/questions/44275940/github-and-travis-ci-how-to-fail-build-when-tests-fail

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!