Setting up continuous integration with Travis.
Travis CI
The continuous integration build configuration with Travis is located inside the .travis.yml
file. To enable Travis, head over to their website, sign in with GitHub and authorise the webhook. This will take you to their main page where you need to toggle the switch next to the desired repositatory.
Environment Variables in Travis
For sensitive data, such as the codecov
token, environment variables can be stored in the Travis repository settings by clicking on “Add new variable” in the “Environment Variables” section on Travis’ website. Environment variables can accessed in the usual way by using $VAR_NAME
.
Codecov with Travis
After a successful build, the xml
code coverage report can be send in a yaml
file by with
after_success:
- codecov
This is for public repositories only, for private repositories you need to use
after_success:
- codecov -t [the_repository_upload_token]
To obtain the token, head over to Codecov and log in with your GitHub credentials, click “Add a repository” and select a repository which will display an upload token.
Containers
The different python build jobs are located in the .travis.yml
file under
language: python
python:
- "2.7"
- "3.6"
- "3.7-dev"
Where each item is a separate EC2 container, with the specified version of Python.