build
, run
, and test
.
This course is updated in September 2025 and covers Bazel 9.
Outline
Introduction
Touches on what Bazel is and what advantages it has over alternatives. By the end of this section, you will be able to explain to a co-worker why your organization chose to use it, and should have Bazel installed so you can runbazel version
.
What is a build system?
Bazel’s Essential Properties
Mental model
Bazel’s Ecosystem
Installing Bazel
Project Structure
Bazel has some terminology and conventions for which files must appear. Create a repository Bazel Modules (MODULE.bazel
)
Flags
Configuring the Build
To configure Bazel, you need to authorBUILD
files, and sometimes improve how they are written.
Packages, Rules, Targets, and Labels
Create and update BUILD
files
The build
and run
commands
Manually using rules in BUILD
files
Running Tests
Now that you are able to build the code, you should figure out if it’s working. By the end of this section, you’ll have usedbazel test
to run some automated tests for the language you picked.
The test
command
How Bazel runs tests
Flags and Tags
Coverage and Test Cases
Flakiness