In Travis CI, can I run the script after all my build matrices have succeeded?

I use Travis CI to create my Python project. I would like to test my project on different versions of Python, but then there is a script that runs only if all of them are successful.

For example, this travis.yml does not do the job, since the after_success part is run after each Python build:

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?

+7
python travis-ci
source share
3 answers

We are working on something similar, but, unfortunately, now this is not possible directly from Travis.

You can use webhooks to do this, which will query the url for you. Depending on what you need, this may work for you.

+1
source share

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

It is not as clean in the .travis.yml file as your proposal, which (as noted in trask) is currently suspended, as described in https://github.com/travis-ci/travis-ci/issues/929 ; the developers say: "We know about the request, but do not have an ETA when it is ready."

+1
source share

This is now possible with the Build Stages feature (currently in beta).

In your particular case, you should add something like:

 jobs: include: - stage: deploy script: ./deploy python: - '2.7' - '3.2' 

to your .travis.yml .

See this page for an example.

(Note: I redefined python at the deployment stage, because by default it simply takes the first value from the matrix, as defined in the default task ( test ). I have not tested this, but I assumed that the matrix extension works during the build steps.)

0
source share

All Articles