问题
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