/bazel_travis_toolbox

Use as a Git submodule for easy Travis CI installation of Bazel

Primary LanguageShellApache License 2.0Apache-2.0

Welcome to the Bazel Travis Toolbox Travis CI Build Status

The goal of this repository is to make it as simple as possible to add Travis CI build support for Bazel projects on Travis.

Why use this?

Travis is a great tool for automatically building and testing changes to projects, but can be tedious and fickle to set up for every project. The intention of this repository is to consolidate as much of the work and duplicate code between projects as possible and reduce the complexity of the .travis.yml as much as possible.

Integration

  1. Add this as a submodule
git submodule add https://github.com/quittle/bazel_travis_toolbox
  1. Create the .travis.yml file in the root of the repository
  2. Add the following to .travis.yml
env:
    # Environment variables are where input to the travis toolbox goes. Add the version of Bazel
    # required for the project.
    - BAZEL_VERSION='0.29.1'

sudo: required # Required to allow this package to handle installing required packages.

before_install:
    # Install required packages, and download and install Bazel.
    - ./bazel_travis_toolbox/before_install.sh

script:
    # Builds all targets
    - bazel build ...
    # Runs all tests
    - bazel test ...