Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Travis CI, can I run a script after all of my build matrix has succeeded?

I'm using Travis CI to build my Python project. I'd like to test my project against different versions of Python, but then have a script that runs only if all of them are successful.

For example, this travis.yml doesn't do the job, since the after_success part runs after each of the Python builds:

language: python
python:
  - '2.7'
  - '3.2'
script:
  - python setup.py test
after_success:
  - # this runs both on 2.7 and 3.2

Is there any way to do this?

like image 427
thomson_matt Avatar asked Jul 30 '13 07:07

thomson_matt


2 Answers

We are working on something like this, but unfortunately it's not possible right now directly from Travis.

You could use webhooks for this, which would make a request to a URL for you. Depending on what you need, this may work for you.

like image 102
sarahhodne Avatar answered Oct 31 '22 10:10

sarahhodne


There are solutions at https://github.com/alrra/travis-after-all and https://github.com/dmakhno/travis_after_all .

It's not as clean in the .travis.yml file as your proposal, which (as noted by trask) is currently on hold as described at https://github.com/travis-ci/travis-ci/issues/929; the developers say "we are aware of the request but don't have an ETA on when it will be ready."

like image 35
mernst Avatar answered Oct 31 '22 10:10

mernst