Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/multi_arch_ci_asan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ on:
type: string
default: ""
description: "Workflow run ID to copy prebuilt stage artifacts from; required when prebuilt_stages is set"
pull_request:
types:
- labeled
- opened
- synchronize

permissions:
contents: read
Expand Down Expand Up @@ -73,7 +78,7 @@ jobs:
id-token: write

ci_summary:
name: CI Summary
name: CI ASAN Summary

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a branch that updates these all to be unambiguous, fyi:

The "name" CI Summary shows up in the UI:

Image

The job name in code ci_summary matters for required checks:

Notes:
* Choose a name for the summary step that is unique across workflow files.
ci.yml should use ci_summary, unit_tests.yml should use unit_tests_summary, etc.
This ensures that required checks can be added in the github UI without
the ambiguity of names overlapping.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops let me revert that then!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't mind you including the same change here... I'm juggling too many branches and idk when I'll finish + send that 😅

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's no problem :) i would rather not complicate things for u

if: always()
needs:
- setup
Expand All @@ -86,6 +91,4 @@ jobs:
GITHUB_TOKEN: ${{ github.token }}
run: |
python build_tools/github_actions/workflow_summary.py \
--workflow-name="${{ github.workflow }}" \
--run-id="${{ github.run_id }}" \
--run-attempt="${{ github.run_attempt }}"
--needs-json '${{ toJSON(needs) }}'
1 change: 1 addition & 0 deletions build_tools/github_actions/amdgpu_family_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def select_build_runner(platform: str, build_variant: str) -> str:
"build_variant_label": "asan",
"build_variant_suffix": "asan",
"build_variant_cmake_preset": "linux-release-asan",
"expect_failure": True,
},
Comment on lines 99 to 103

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expect_failure is not working with multi-arch CI when last I analyzed it. I want to remove it. See #4500

"tsan": {
"build_variant_label": "tsan",
Expand Down
14 changes: 14 additions & 0 deletions build_tools/github_actions/configure_multi_arch_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,20 @@ def should_skip_ci(
print(" Skipping: 'ci:skip' PR label")
return True

# Skip ASAN on PRs unless submodule changes are present.
# This avoids running expensive ASAN builds on every PR while still
# catching ASAN issues when library code (submodules) changes.
if (
ci_inputs.is_pull_request
and ci_inputs.build_variant == "asan"
and git_context.changed_files is not None
and git_context.submodule_paths is not None
):
matching = set(git_context.submodule_paths) & set(git_context.changed_files)
if not matching:
print(" Skipping: ASAN PR without submodule changes")
return True
Comment on lines +504 to +518

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People are going to send their own [draft] PRs that include submodule updates outside of our regularly scheduled bumps, and this is going to run expensive ASan builds on those PRs.

I bet we'll want a system like https://github.com/iree-org/iree/blob/fbe60d8c0fc391d5f64fe0a71bca330f7bff445c/build_tools/github_actions/configure_ci.py#L203-L212

Let's keep an eye on this. Probably worth a TODO or more details in the comment.


# If we have a list of changed files (push/pull_request events), check if
# CI should run for that set of changed files. For example: if only .md
# files are changed, skip CI.
Expand Down
36 changes: 36 additions & 0 deletions build_tools/github_actions/tests/configure_multi_arch_ci_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,42 @@ def test_none_changed_files_skips_path_filter(self, mock_filter):
self.assertFalse(cm.should_skip_ci(inputs, git))
mock_filter.assert_not_called()

def test_asan_pr_without_submodule_change_skips(self):
"""ASAN PR without submodule changes skips CI."""
inputs = self._inputs(build_variant="asan", pr_labels=[])
git = cm.GitContext(
changed_files=["CMakeLists.txt", "build_tools/script.py"],
submodule_paths=["rocm-libraries", "rocm-systems"],
)
self.assertTrue(cm.should_skip_ci(inputs, git))

def test_asan_pr_with_submodule_change_runs(self):
"""ASAN PR with submodule changes runs CI."""
inputs = self._inputs(build_variant="asan", pr_labels=[])
git = cm.GitContext(
changed_files=["rocm-libraries", "CMakeLists.txt"],
submodule_paths=["rocm-libraries", "rocm-systems"],
)
self.assertFalse(cm.should_skip_ci(inputs, git))

def test_asan_non_pr_runs_regardless_of_submodule(self):
"""ASAN on schedule/push runs regardless of submodule changes."""
inputs = self._inputs(event_name="schedule", build_variant="asan")
git = cm.GitContext(
changed_files=None,
submodule_paths=["rocm-libraries"],
)
self.assertFalse(cm.should_skip_ci(inputs, git))

def test_release_pr_without_submodule_change_runs(self):
"""Release variant PR without submodule changes still runs (not skipped)."""
inputs = self._inputs(build_variant="release", pr_labels=[])
git = cm.GitContext(
changed_files=["CMakeLists.txt"],
submodule_paths=["rocm-libraries"],
)
self.assertFalse(cm.should_skip_ci(inputs, git))


# ---------------------------------------------------------------------------
# Step 3: Decide Jobs
Expand Down
Loading