-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
gh-142278: Add granular change detection for platforms in CI #142350
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
base: main
Are you sure you want to change the base?
Conversation
| ${{ | ||
| !fromJSON(needs.build-context.outputs.run-windows-tests) | ||
| && ' | ||
| build-windows, | ||
| ' | ||
| || '' | ||
| }} | ||
| ${{ | ||
| !fromJSON(needs.build-context.outputs.run-ci-fuzz) | ||
| && ' | ||
| cifuzz, | ||
| ' | ||
| || '' | ||
| }} | ||
| ${{ | ||
| !fromJSON(needs.build-context.outputs.run-macos) | ||
| && ' | ||
| build-macos, | ||
| ' | ||
| || '' | ||
| }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These check a single job, perhaps make them one-liners?
| ${{ | |
| !fromJSON(needs.build-context.outputs.run-windows-tests) | |
| && ' | |
| build-windows, | |
| ' | |
| || '' | |
| }} | |
| ${{ | |
| !fromJSON(needs.build-context.outputs.run-ci-fuzz) | |
| && ' | |
| cifuzz, | |
| ' | |
| || '' | |
| }} | |
| ${{ | |
| !fromJSON(needs.build-context.outputs.run-macos) | |
| && ' | |
| build-macos, | |
| ' | |
| || '' | |
| }} | |
| ${{ !fromJSON(needs.build-context.outputs.run-windows-tests) && 'build-windows,' || '' }} | |
| ${{ !fromJSON(needs.build-context.outputs.run-ci-fuzz) && 'cifuzz,' || '' }} | |
| ${{ !fromJSON(needs.build-context.outputs.run-macos) && 'build-macos,' || '' }} |
Plus for andoid/ios/wasi below?
| value: ${{ jobs.compute-changes.outputs.run-ios }} # bool | ||
| run-wasi: | ||
| description: Whether to run the WASI tests | ||
| value: ${{ jobs.compute-changes.outputs.run-wasi }} # bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole list of outputs doesn't have any special order and its getting long, let's alphabetise, it'll make it easier to find things.
| run-ubuntu: ${{ steps.changes.outputs.run-ubuntu }} | ||
| run-android: ${{ steps.changes.outputs.run-android }} | ||
| run-ios: ${{ steps.changes.outputs.run-ios }} | ||
| run-wasi: ${{ steps.changes.outputs.run-wasi }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And alphabetise this.
| MACOS_DIRS = frozenset({"Mac"}) | ||
| IOS_DIRS = frozenset({"Apple", "iOS"}) | ||
| ANDROID_DIRS = frozenset({"Android"}) | ||
| WASI_DIRS = frozenset({Path("Tools", "wasm")}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| MACOS_DIRS = frozenset({"Mac"}) | |
| IOS_DIRS = frozenset({"Apple", "iOS"}) | |
| ANDROID_DIRS = frozenset({"Android"}) | |
| WASI_DIRS = frozenset({Path("Tools", "wasm")}) | |
| ANDROID_DIRS = frozenset({"Android"}) | |
| IOS_DIRS = frozenset({"Apple", "iOS"}) | |
| MACOS_DIRS = frozenset({"Mac"}) | |
| WASI_DIRS = frozenset({Path("Tools", "wasm")}) |
| run_ubuntu: bool = False | ||
| run_android: bool = False | ||
| run_ios: bool = False | ||
| run_wasi: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alphabetise
| return frozenset(map(Path, filter(None, map(str.strip, changed_files)))) | ||
|
|
||
|
|
||
| def is_platform_specific(file: Path) -> str | None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename this, because the is_ prefix makes me think it returns bool.
| run_windows_msi = False | ||
|
|
||
| platforms_changed = set() | ||
| has_non_plat_specific_change = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| has_non_plat_specific_change = False | |
| has_platform_specific_change = True |
| if file.parent == GITHUB_WORKFLOWS_PATH: | ||
| if file.name == "build.yml": | ||
| run_tests = run_ci_fuzz = True | ||
| run_tests = run_ci_fuzz = has_non_plat_specific_change = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| run_tests = run_ci_fuzz = has_non_plat_specific_change = True | |
| run_tests = run_ci_fuzz = True | |
| has_platform_specific_change = False |
| if platform is not None: | ||
| platforms_changed.add(platform) | ||
| else: | ||
| has_non_plat_specific_change = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| has_non_plat_specific_change = True | |
| has_platform_specific_change = False |
|
|
||
| # Check which platform specific tests to run | ||
| if run_tests: | ||
| if has_non_plat_specific_change or not platforms_changed: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if has_non_plat_specific_change or not platforms_changed: | |
| if not has_platform_specific_change or not platforms_changed: |
Uh oh!
There was an error while loading. Please reload this page.