10000 [ci] dynamic ci by sharder996 · Pull Request #4135 · canonical/multipass · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[ci] dynamic ci #4135

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

[ci] dynamic ci #4135

wants to merge 13 commits into from

Conversation

sharder996
Copy link
Contributor
@sharder996 sharder996 commented Jun 2, 2025

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, 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 ([docs] example docs changes #4136)
  1. Documentation changes that fail to build ([docs] docs failure #4143)
  2. Source code changes ([code] example code changes #4137)
  3. Changes that are neither documentation or source code ([readme] non docs and non code changes #4142)
  4. Changing both documentation and code, but having one fail (docs failure and code changes #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 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 which does not offer the granularity or control of being able to selectively control when the workflow is run.

Future development

One slight improvement that can be made to further optimization CI only running necessary builds is 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.


MULTI-1932


Closes #4136
Closes #4143
Closes #4137
Closes #4142
Closes #4144

Copy link
codecov bot commented Jun 2, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.31%. Comparing base (110192b) to head (80b82ca).
Report is 41 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4135   +/-   ##
=======================================
  Coverage   89.31%   89.31%           
=======================================
  Files         259      259           
  Lines       15708    15708           
=======================================
  Hits        14029    14029           
  Misses       1679     1679           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ricab
Copy link
Collaborator
ricab commented Jun 12, 2025

Addresses #4042.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0