docs: Add notes about GitHub Actions
Bug: b/338083578
Change-Id: Iab9f9ed13c1caf8e8403c34093ab9cd269d22916
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/211135
Pigweed-Auto-Submit: Rob Mohr <mohrr@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
diff --git a/docs/BUILD.gn b/docs/BUILD.gn
index ce85525..b178e04 100644
--- a/docs/BUILD.gn
+++ b/docs/BUILD.gn
@@ -62,6 +62,7 @@
"get_started/zephyr.rst",
"glossary.rst",
"infra/ci_cq_intro.rst",
+ "infra/github.rst",
"infra/index.rst",
"infra/rollers.rst",
"mission.rst",
diff --git a/docs/infra/github.rst b/docs/infra/github.rst
new file mode 100644
index 0000000..be588b3
--- /dev/null
+++ b/docs/infra/github.rst
@@ -0,0 +1,67 @@
+.. _docs-github:
+
+===========
+GitHub
+===========
+
+--------
+Overview
+--------
+
+Pigweed itself uses `LUCI <luci>`_ for
+:abbr:`CI/CD (Continuous Integration/Continuous Deployment)`. LUCI is
+well-supported within Google but complicated to deploy, so Pigweed has support
+for `GitHub Actions <github-actions>`_ as well.
+
+.. _github-actions: https://docs.github.com/en/actions
+
+Bazel
+=====
+Configuring a Bazel builder that runs on pull requests is straightforward.
+There are four steps: `checkout <github-actions-checkout>`_,
+`get Bazel <github-actions-bazel>`_, build, and test. There are good
+community-managed actions for the first two steps, and the last two steps are
+trivial (and can even be combined).
+
+.. _github-actions-checkout: https://github.com/marketplace/actions/checkout
+.. _github-actions-bazel: https://github.com/marketplace/actions/setup-bazel-environment
+
+The Bazel version retrieved is configured through a ``.bazelversion`` file in
+the root of the checkout.
+
+.. code-block:: yaml
+
+ name: basic
+ run-name: presubmit run triggered by ${{ github.actor }}
+
+ on:
+ pull_request:
+ types: [opened, synchronize, reopened]
+
+ jobs:
+ bazel-build-test:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+ submodules: recursive
+ - name: Get Bazel
+ uses: bazel-contrib/setup-bazel@0.8.1
+ with:
+ # Avoid downloading Bazel every time.
+ bazelisk-cache: true
+ # Store build cache per workflow.
+ disk-cache: ${{ github.workflow }}
+ # Share repository cache between workflows.
+ repository-cache: true
+ - name: Bazel Build
+ run: bazel build ...
+ - name: Bazel Test
+ run: bazel test ...
+
+``pw presubmit``
+================
+Tests that require using `pw_env_setup <module-pw_env_setup>`_ and
+`pw_presubmit <module-pw_presubmit>`_ are not yet supported.
diff --git a/docs/infra/index.rst b/docs/infra/index.rst
index 91b798e..89b43e8 100644
--- a/docs/infra/index.rst
+++ b/docs/infra/index.rst
@@ -5,5 +5,6 @@
.. toctree::
:maxdepth: 1
+ github
ci_cq_intro
rollers