Skip to content

Testing with Travis CI

Travis CI is a continuous integration service that works alongside GitHub to run tests whenever new commits are made to a repository. Other such services include Circle CI and Bitrise, as well as standalone software such as Jenkins.

Travis CI is currently used for Birch development. This page explains how you can set up Travis CI for your own Birch projects, too.

After signing up for the Travis CI service, you will need to add a .travis.yml file to your code repository. A suggested template for Birch projects is as follows:

language: cpp
    # macOS environment
    - os: osx
      compiler: clang
      osx_image: xcode10.3
          update: true
            - flex
            - bison
            - eigen
            - libyaml
            - libomp

    # Ubuntu 16.04 environment
    - os: linux
      dist: xenial
      compiler: gcc
            - autoconf
            - libtool
            - flex
            - bison
            - libeigen3-dev
            - libyaml-dev
            - libboost-all-dev
  # Checkout Birch, which may be cached, and (re)build
  - git clone "" || cd .
  - cd Birch && git stash && git pull && git checkout master && ./ && ./configure INSTALL="install -p" && make -j 2 && sudo make install && cd ..

  # Checkout Birch.Standard, which may be cached, and (re)build
  - git clone "" || cd .
  - cd Birch.Standard && git stash && git pull && git checkout master && birch build && sudo birch install && cd ..

  - birch build && sudo birch install
  - ./
    - Birch
    - Birch.Standard

This sets up both macOS and Ubuntu builds, and caches the Birch compiler and Birch standard library to recompile them only when necessary. Anecdotally, for Birch.Standard, we observe that tests take 6-8 minutes for each instance, reducing to 3-4 minutes with an up-to-date cache.