Simple steps to add Travis CI to your Pebble project repo on Github

Posted by Yaoyu Yang on March 12, 2016

I have been working on a Pebble watch app called CatchOneBus for almost a year. The project’s source code is hosted on Github and I want to add integration with Travis CI to have that cool Build Status icon light up! Even though lighting up the icon is my biggest motivation for now, Travis CI is way more than an icon for sure. Travis CI is a continuous integration service used to build and test software projects hosted at GitHub. Simply speaking, it can run your project on a machine in the cloud as if you are running the project on your local machine and tell you if it can run successfully or not. Using Travis also gives you the confidence that it has been tested on other machines other than your local machine.

Anyway, here are the steps for add Travis CI in your Pebble app project repo:

  • Add Travis CI integration to your Github by clicking Add to Github.

  • Head to your Travis CI profile page and flick the repository switch on for your pebble project repo.

  • Add a .travis.yml into your Github Pebble project repo. You open this and copy or directly copy the following code snippet into your .travis.yml file.

sudo: false
language: python
python:
  - "2.7"

env:
  - PEBBLE_SDK_VERSION=3.10.1

before_install:
  - wget https://s3.amazonaws.com/assets.getpebble.com/pebble-tool/pebble-sdk-4.2.1-linux64.tar.bz2
  - mkdir -p ~/.pebble-sdk
  - tar -jxf pebble-sdk-* -C ~/.pebble-sdk
  - touch ~/.pebble-sdk/ENABLE_ANALYTICS
  - export PEBBLE_SDK=~/.pebble-sdk/pebble-sdk-*
  - export PEBBLE=$PEBBLE_SDK/bin/pebble

install:
  - pushd $PEBBLE_SDK
  - virtualenv --no-site-packages .env
  - source .env/bin/activate
  - pip install -r requirements.txt
  - deactivate
  - popd
  - $PEBBLE sdk set-channel beta
  - yes | $PEBBLE sdk install $PEBBLE_SDK_VERSION

script:
  - $PEBBLE build
  • Trigger your first build with a git push.

  • Head over to Travis CI. Once it’s finishing building , the text and icon color will turn to green. Click the Build Status icon next to the icon. Select MARKDOWN and copy the code into your README.md file.

  • You should now see the cool Build Status icon light up in your project repo!