Skip to content

Commit 18df40e

Browse files
[Github][Docs] Add testing best practices to CI Best Practices Doc (#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.
1 parent 3a522b1 commit 18df40e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

llvm/docs/CIBestPractices.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,24 @@ branches as follows:
137137
- main
138138
- release/*
139139
140+
Make Workflows Run on Updates to the Workflow Definition
141+
--------------------------------------------------------
142+
143+
Whenever possible, workflows should also run whenever the workflow definition
144+
is updated. This enables easily testing the workflow whenever modifying it. For
145+
example, if we have a workflow with a definition in ``.github/workflows/foo.yaml``,
146+
we should have at least the following event within the workflow:
147+
148+
.. code-block:: yaml
149+
150+
pull_request:
151+
paths:
152+
- .github/workflows/foo.yaml
153+
154+
Note that it is not always possible to enable this (e.g., issues that use a
155+
``workflow_run`` trigger). But when possible, this makes testing the workflow
156+
much simpler.
157+
140158
Container Best Practices
141159
========================
142160

0 commit comments

Comments
 (0)