Setting up Travis CI for Open Source REDI project¶
Steps to setup Travis CI for RED-I¶
- Sign in to travis using Github account (ctsit)
- Give permissions to travis to clone and sync github repositories when asked.
- Activate a webhook on the repo on your choice
- Go to repositories in your profile (Click on your profile as shown below)
- Flip the switch against the repo of your choice to enable webhook for that repo as displayed in the image below.
- Create a .travis.yml file and add it to your repository. I have created a basic .travis.yml, which work for current REDI. Below are its contents
language: python python: - "2.7" before_install: sudo apt-get install -y python-setuptools libxml2 libxslt1-dev python-dev install: - pip install requests - pip install lxml - pip install appdirs script: make test branches: only: - master - develop
- The contents listed above are pretty basic. For any additional features you need to configure refer this link.
- Travis is now configured to your repository. For each new commit made to the master branch, travis will run new build for your repository and results will be mailed to the email registered in your github account.
- You can also view results on your Travis dashboard as shown in the below image.
CTS-IT Responsibilities when a pull request is submitted on REDI¶
- When REDI gets a pull request, CTS-IT coordinator should open the pull request. This initiates Travis to run tests against pull request and displays the results.
- Pull requests that passed the tests looks like as shown in the image.
- Pull requests that failed the tests looks like as shown in the image below.
Responsibilities of the developer submitting a pull request:¶
- Fork the REDI repository. You will get a .travis.yml with the fork.
- Setup a travis account for your github account and give permissions for travis to run build.
- With this you should receive travis reports for each commit you push to your forked repository.
- Before submitting a pull request, make sure tests in your travis report are all passing.