Workflows automatically build and test your code with BuildBuddy whenever a commit is pushed to your GitHub repo.
When combined with GitHub's branch protection rules, workflows can help prevent unwanted code (that doesn't build or pass tests) from being merged into the main branch.
Best of all, workflows let you run any Bazel commands you would like, so you can leverage all the same BuildBuddy features that you get when running Bazel locally, like the results UI, remote caching, remote execution.
If you use GitHub, make sure that your BuildBuddy org has a GitHub org linked to it, using the "Link GitHub account" button from the settings page.
Click Workflows in the BuildBuddy app and select a repo to be linked to BuildBuddy.
Then, BuildBuddy will run
bazel test //... whenever a commit is pushed to
your repo. It reports the status of the test as well as BuildBuddy links to
GitHub, which you can see on the repo's home page or in pull request branches.
To learn how to change the default configuration, see workflows configuration.
After you have created a workflow and you've pushed at least one commit to the repo, you can configure your repo so that branches cannot be merged unless the workflow succeeds.
To do this, go to Settings > Branches and find Branch protection rules. Then, you click Add rule (or edit an existing rule).
Select the box Require status checks to pass before merging and enable the check corresponding to the BuildBuddy workflow (by default, this should be Test all targets).
After you save your changes, pull requests will not be mergeable unless the tests pass on BuildBuddy.
BuildBuddy workflows execute using Docker on a recent Ubuntu base image (Ubuntu 18.04 at the time of this writing), with some commonly used tools and libraries pre-installed.
If you would like to test whether your build will succeed with
BuildBuddy workflows without having to set up and trigger the workflow,
you can instead run the image with Docker, clone your Git repo, and invoke
bazel to run your tests.
The Dockerfile we use to build the image (at
HEAD) is here.