Commit 645b541
[ci] dynamic ci (#4135)
This PR revamps how our GitHub workflows are invoked so that only the
necessary workflows are run and we avoid situations where a change to
the `README.md` gets blocked on an Apple runner failing to compile
Multipass due to a spurious seg fault.
This setup works by having a single orchestration workflow which filters
the changed files with
[dorny/paths-filter](https://github.com/dorny/paths-filter), defines
relevant outputs, and then spawns the relevant workflows. A "Finalize"
job in the orchestration workflow then checks the return statuses of the
spawned workflows and sets it own return status accordingly.
Regarding branch protection rules, the idea is that we would protect on
`Dynamic-CI \ Filter changed files` and `Dynamic-CI \ Finalize` to make
sure that the PR is properly analyzed and and errors from spawned
workflows are propagated up, effectively gating the PR from being
merged.
Below are some example draft PRs demonstrating various scenarios and how
the new CI setup reacts to them.
1. Documentation changes (#4136)
-
https://github.com/canonical/multipass/actions/runs/15478104252/job/43578947769?pr=4136
demonstrates a run that has been cancelled.
2. Documentation changes that fail to build (#4143)
3. Source code changes (#4137)
4. Changes that are neither documentation or source code (#4142)
5. Changing both documentation and code, but having one fail (#4144)
Merge queues aren't officially supported in the `dorny/paths-filter`
action, but there are several user submitted examples of people using
the action in this manner. Because of repository permissions this has
yet to have been tested.
Another GitHub action;
[tj-actions/changed-files](https://github.com/tj-actions/changed-files)
was considered for added functionality of being able to spawn workflows.
However, I chose not to go with it due to it's increased complexity and
granularity of control that isn't strictly needed in our setup.
One other thing, `docs/readthedocs.com:canonical-multipass` will
continue to be built for every PR regardless of changed files. The
trigger for this workflow is managed by
[ReadtheDocs](https://app.readthedocs.com/dashboard/canonical-multipass/pull-requests/)
which does not offer the granularity or control of being able to
selectively control when the workflow is run.
One slight improvement that can be made to further optimize CI would be
to bisect `windows-macos.yml` and further filter on files that only
affect Windows or macOS builds. However, care would need to be taken in
order to ensure that there is no unnoticed cross-platform dependencies
in these filtered files.
Closes #4136
Closes #4143
Closes #4137
Closes #4142
Closes #4144
---
MULTI-1932
---1 parent 9b97ef7 commit 645b541
6 files changed
Lines changed: 7 additions & 56 deletions
File tree
- .github
- actions/check-lint
- workflows
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
| 5 | + | |
16 | 6 | | |
17 | 7 | | |
18 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
57 | 56 | | |
58 | 57 | | |
59 | 58 | | |
| 59 | + | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
65 | | - | |
66 | 64 | | |
67 | 65 | | |
68 | 66 | | |
| |||
90 | 88 | | |
91 | 89 | | |
92 | 90 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | 91 | | |
100 | 92 | | |
101 | 93 | | |
102 | 94 | | |
103 | | - | |
| 95 | + | |
104 | 96 | | |
105 | 97 | | |
106 | 98 | | |
| |||
115 | 107 | | |
116 | 108 | | |
117 | 109 | | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 4 | + | |
14 | 5 | | |
15 | 6 | | |
16 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 4 | + | |
14 | 5 | | |
15 | 6 | | |
16 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 4 | + | |
14 | 5 | | |
15 | 6 | | |
16 | 7 | | |
| |||
0 commit comments