This repository is an example of how to use Bazel to build a C++ project on Buildkite.
Note: this example assumes you've already installed Bazel on your Buildkite Agent.
The empty WORKSPACE
file marks the directory as a Bazel workspace, and the main/BUILD
contains the Bazel build targets.
The Buildkite pipeline.yml file tells Bazel to build the hello-world
target in main/BUILD
:
steps:
- label: ":bazel: Build"
commands:
- bazel build //main:hello-world
The hello-world
target uses the Bazelcc_binary
rule to build a hello-world
executable from the source file hello-world.cc
.
If you want to test the result by running the resulting binary, add the following line to your copy of the Pipeline:
- bazel-bin/main/hello-world
See License.md (MIT)