The goal of this repository is to make it as simple as possible to add Travis CI build support for Bazel projects on Travis.
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.
- Add this as a submodule
git submodule add https://github.com/quittle/bazel_travis_toolbox
- Create the
.travis.yml
file in the root of the repository - 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 ...