-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Exclude jobs based on branch name #7149
Comments
matrix:
- python: "3.6"
- python: "2.7"
before_install:
- if ! [[ $TRAVIS_TAG ]]; then exit 0; fi works to bail out early, but you still need to wait for the machine to be provisioned and the setup that happens |
This feature is useful for Build Stages. |
Same requirement over here. We are building an Android It'd be nice if it could be skipped altogether. Something like an |
This feature is super useful for partial builds. |
travis doesn't support running stages based on branch - see travis-ci/travis-ci#7149
Same issue on our side. The "deploy" job still has to boot up and run even for PR builds where we definitely do not want to deploy code. |
feature was already approved , more info at travis-ci/beta-features#11 |
Details: - So far, some combinations in the build matrix were simply commented out. The idea was always to activate them again, when the Travis run is a cron-triggered run. However, Travis does not support conditionals in the build matrix definition. This change uses the before_install keyword on a build matrix item to exit if not in a cron-triggered run, on the matrix items that had been commented out so far. This trick is described in a response to Travis issue #7149 travis-ci/travis-ci#7149 - Because more combinations are now active again, added a check for the operating system to the invocation of coveralls, in order to make sure that it is being invoked only once. Signed-off-by: Andreas Maier <maiera@de.ibm.com>
While it is considered beta (some future changes are possible), our recent release of the Build Stages feature makes this possible. https://blog.travis-ci.com/2017-09-12-build-stages-order-and-conditions In the use case of OP:
One can write: language: python
python:
- "3.6"
matrix:
include:
- python: "2.7"
if: branch =~ ^deploy |
@BanzaiMan I had success with your suggestion by flipping the order of the language: python
python:
- "3.6"
matrix:
include:
- if: branch =~ ^deploy
python: "2.7" |
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues |
Hello,
I'm sorry if this topic is covered somewhere in the documentation, I wasn't able to find an answer anywhere.
I want to exclude jobs from my matrix depending of the branch name.
For instance, let's say I have two Python jobs:
I want to exclude "2.7" if branch names startswith "deploy", but do everything if not ("master", PRs, etc.).
Deployment framework already allows me to deploy only if "python" is "3.6", but the other job are still executed (for nothing, waste of time and resources).
I was looking for a way to declare that in "exclude" of "matrics" (of anywhere else to achieve the goal :))
Workaround tentative: is there a way to skip a job from a before_install step (so I can check
$TRAVIS_TAG
and exit)?Thank you!
The text was updated successfully, but these errors were encountered: