[llvm] [Github][Docs] Add testing best practices to CI Best Practices Doc (PR #172235)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 14 14:46:10 PST 2025


https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/172235

We have a practice of making workflows run whenever their workflow definition is changed to make them easy to test. Document this as a best practice to have something to point to during code review.

>From b0f4734de03d83d99d864d157713e374f84dc4ff Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Sun, 14 Dec 2025 22:44:51 +0000
Subject: [PATCH] [Github][Docs] Add testing best practices to CI Best
 Practices Doc

We have a practice of making workflows run whenever their workflow
definition is changed to make them easy to test. Document this as a best
practice to have something to point to during code review.
---
 llvm/docs/CIBestPractices.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/llvm/docs/CIBestPractices.rst b/llvm/docs/CIBestPractices.rst
index 2260f1fa54a92..d6d56690a2fed 100644
--- a/llvm/docs/CIBestPractices.rst
+++ b/llvm/docs/CIBestPractices.rst
@@ -137,6 +137,24 @@ branches as follows:
       - main
       - release/*
 
+Make Workflows Run on Updates to the Workflow Definition
+--------------------------------------------------------
+
+Whenever possible, workflows should also run whenever the workflow definition
+is updated. This enables easily testing the workflow whenever modifying it. For
+example, if we have a workflow with a definition in ``.github/workflows/foo.yaml``,
+we should have at least the following event within the workflow:
+
+.. code-block:: yaml
+
+  pull_request:
+    paths:
+     - .github/workflows/foo.yaml
+
+Note that it is not always possible to enable this (e.g., issues that use a
+``workflow_run`` trigger). But when possible, this makes testing the workflow
+much simpler.
+
 Container Best Practices
 ========================
 



More information about the llvm-commits mailing list