Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

exclude files from triggering a travis ci build on github

Our organization uses travis-ci within github for basic sanity checking when a change is committed. Is there a way to prevent a full travis build/run when changes to specific files or file types are made?

As the simplest example: if someone makes a change to the README.md file and wants to commit directly to master, we don't need to do a CI run before allowing this.

like image 789
ljwobker Avatar asked Sep 25 '15 22:09

ljwobker


People also ask

Which of the following file is used to configure the Travis CI?

Configuration. Travis CI is configured by adding a file named . travis. yml , which is a YAML format text file, to the root directory of the repository.

How do you trigger a Travis CI build?

Trigger Travis CI builds using the API V3 by sending a POST request to /repo/{slug|id}/requests : Get an API token from your Travis CI settings page. You'll need the token to authenticate most of these API requests.


1 Answers

You might instruct your team to add [skip ci] to your commit messages, e.g.

git commit -m "updated readme [skip ci]".

This means that this Github commit (after it is pushed) will not trigger a Travis-CI run.

The alternative is to accept that a commit triggers a Travis-CI run, but then simply do condition checks inside your .travis.yml (or scripts executed by it) to exclude processing of unit-tests, etc. In other words: there will be a CI run, but all heavy script stuff could be skipped.

like image 136
Jens A. Koch Avatar answered Sep 21 '22 18:09

Jens A. Koch