Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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
33 changes: 20 additions & 13 deletions .github/workflows/ci-workflow-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,6 @@ jobs:
pytorch_enabled: ${{ steps.export-flags.outputs.pytorch_enabled }}
branch_notes_dirt: ${{ steps.branch-notes-dirt.outputs.branch_notes_dirt }}
steps:
- name: Export workflow flags
id: export-flags
env:
skip_tpt: ${{ contains(github.event.head_commit.message, '[bench-only]') || contains(github.event.head_commit.message, '[skip-tpt]') || contains(github.event.head_commit.message, '[skip-third-party-testing]') }}
run: |
output() { echo "$1=$2" | tee -a "${GITHUB_OUTPUT}"; }

output matrix_enabled "${{ !contains(github.event.head_commit.message, '[bench-only]') && !contains(github.event.head_commit.message, '[skip-matrix]') }}"
output vdc_enabled "${{ !contains(github.event.head_commit.message, '[bench-only]') && !contains(github.event.head_commit.message, '[skip-vdc]') }}"
output docs_enabled "${{ !contains(github.event.head_commit.message, '[bench-only]') && !contains(github.event.head_commit.message, '[skip-docs]') }}"
output rapids_enabled "${{ !contains(github.event.head_commit.message, '[skip-rapids]') && !fromJSON(env.skip_tpt) }}"
output matx_enabled "${{ !contains(github.event.head_commit.message, '[skip-matx]') && !fromJSON(env.skip_tpt) }}"
output pytorch_enabled "${{ !contains(github.event.head_commit.message, '[skip-pytorch]') && !fromJSON(env.skip_tpt) }}"
- name: Checkout repo
uses: actions/checkout@v6
with:
Expand All @@ -87,6 +74,26 @@ jobs:
echo "pr_number=${{ fromJSON(steps.get-pr-info.outputs.pr-info).number }}" | tee -a "${GITHUB_OUTPUT}"
git fetch origin "${BASE_SHA}" -q
echo "merge_base_sha=$(git merge-base "${BASE_SHA}" "${GITHUB_SHA}")" | tee -a "${GITHUB_OUTPUT}"
- name: Inspect changes for third-party tests
id: inspect-third-party-changes
env:
BASE_SHA: ${{ steps.export-pr-info.outputs.base_sha }}
run: |
# This also runs when the main matrix is disabled with [skip-matrix].
./ci/inspect_changes.py --refs "${BASE_SHA}" "${GITHUB_SHA}"
- name: Export workflow flags
id: export-flags
env:
skip_tpt: ${{ steps.inspect-third-party-changes.outputs.HAS_NON_IGNORED_CHANGES != 'true' || contains(github.event.head_commit.message, '[bench-only]') || contains(github.event.head_commit.message, '[skip-tpt]') || contains(github.event.head_commit.message, '[skip-third-party-testing]') }}
run: |
output() { echo "$1=$2" | tee -a "${GITHUB_OUTPUT}"; }

output matrix_enabled "${{ !contains(github.event.head_commit.message, '[bench-only]') && !contains(github.event.head_commit.message, '[skip-matrix]') }}"
output vdc_enabled "${{ !contains(github.event.head_commit.message, '[bench-only]') && !contains(github.event.head_commit.message, '[skip-vdc]') }}"
output docs_enabled "${{ !contains(github.event.head_commit.message, '[bench-only]') && !contains(github.event.head_commit.message, '[skip-docs]') }}"
output rapids_enabled "${{ !contains(github.event.head_commit.message, '[skip-rapids]') && !fromJSON(env.skip_tpt) }}"
output matx_enabled "${{ !contains(github.event.head_commit.message, '[skip-matx]') && !fromJSON(env.skip_tpt) }}"
output pytorch_enabled "${{ !contains(github.event.head_commit.message, '[skip-pytorch]') && !fromJSON(env.skip_tpt) }}"
- name: Build benchmark dispatch matrix
id: build-bench-matrix
run: |
Expand Down
11 changes: 8 additions & 3 deletions ci/inspect_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,11 +591,16 @@ def compute_outputs(
return full_output, lite_output


def emit_outputs(full_output: Sequence[str], lite_output: Sequence[str]) -> None:
"""Write FULL_BUILD/LITE_BUILD strings to stdout and GitHub outputs."""
def emit_outputs(
full_output: Sequence[str],
lite_output: Sequence[str],
has_non_ignored_changes: bool,
) -> None:
"""Write rebuild lists and change detection results to GitHub outputs."""
print("Github Action Outputs:")
write_output("FULL_BUILD", " ".join(full_output))
write_output("LITE_BUILD", " ".join(lite_output))
write_output("HAS_NON_IGNORED_CHANGES", str(has_non_ignored_changes).lower())
print()


Expand Down Expand Up @@ -671,7 +676,7 @@ def main(argv: Optional[Sequence[str]] = None) -> int:
full_output, lite_output = compute_outputs(config, full_set, lite_set)

print()
emit_outputs(full_output, lite_output)
emit_outputs(full_output, lite_output, bool(dirty_files))

with SummaryWriter(summary_path) as summary_writer:
print("::group::Project Change Summary")
Expand Down
17 changes: 11 additions & 6 deletions ci/project_files_and_dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,17 @@ projects:
full_dependencies: []
include_regexes: ["nvrtcc/"]

# These files must trigger third-party tests without adding CCCL matrix jobs.
third_party:
name: "Third-party Tests"
include_regexes:
- '\.github/workflows/build-matx\.yml'
- '\.github/workflows/build-pytorch\.yml'
- '\.github/workflows/build-rapids\.yml'
- 'ci/matx/'
- 'ci/pytorch/'
- 'ci/rapids/'

# This is a dummy project, and only really serves to encode dependencies. Any time any
# of the C/C++ projects are modified, we want to launch one (and only one) clang-tidy
# job for the whole of CCCL.
Expand Down Expand Up @@ -268,9 +279,6 @@ ignore_regexes:
- '\.github/workflows/bench.*\.yml'
- '\.github/workflows/compile-time-bench\.yml'
- '\.github/workflows/build-docs\.yml'
- '\.github/workflows/build-matx\.yml'
- '\.github/workflows/build-pytorch\.yml'
- '\.github/workflows/build-rapids\.yml'
- '\.github/workflows/git-bisect\.yml'
- '\.github/workflows/project_automation.*\.yml'
- '\.github/workflows/release.*\.yml'
Expand All @@ -282,8 +290,5 @@ ignore_regexes:
- 'cccl-version.json'
- 'ci/bench/'
- 'ci/bench.+yaml'
- 'ci/matx/'
- 'ci/pytorch/'
- 'ci/rapids/'
- 'docs/'
- 'LICENSE'
1 change: 1 addition & 0 deletions ci/test/inspect_changes/c2h_dependency.output
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FULL_BUILD=tidy
LITE_BUILD=libcudacxx cub cudax cccl_c_parallel cccl_c_parallel_v2 python_v2 cccl_c_stf python packaging
HAS_NON_IGNORED_CHANGES=true
Comment thread
jakezwang marked this conversation as resolved.
Outdated
1 change: 1 addition & 0 deletions ci/test/inspect_changes/core_dirty.output
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FULL_BUILD=libcudacxx cub thrust cudax cccl_c_parallel cccl_c_parallel_v2 python_v2 python_tsan cccl_c_stf python packaging stdpar nvbench_helper nvrtcc tidy
LITE_BUILD=
HAS_NON_IGNORED_CHANGES=true
2 changes: 2 additions & 0 deletions ci/test/inspect_changes/ignored_only.dirty_files
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
docs/index.rst
README.md
.github/actions/docs-build/action.yml
1 change: 1 addition & 0 deletions ci/test/inspect_changes/ignored_only.output
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FULL_BUILD=
LITE_BUILD=
HAS_NON_IGNORED_CHANGES=false
1 change: 1 addition & 0 deletions ci/test/inspect_changes/libcudacxx_both.output
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FULL_BUILD=libcudacxx tidy
LITE_BUILD=cub thrust cudax cccl_c_parallel cccl_c_parallel_v2 python_v2 python_tsan cccl_c_stf python packaging stdpar nvbench_helper
HAS_NON_IGNORED_CHANGES=true
1 change: 1 addition & 0 deletions ci/test/inspect_changes/libcudacxx_internal_only.output
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FULL_BUILD=libcudacxx tidy
LITE_BUILD=packaging
HAS_NON_IGNORED_CHANGES=true
1 change: 1 addition & 0 deletions ci/test/inspect_changes/libcudacxx_public_only.output
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FULL_BUILD=libcudacxx tidy
LITE_BUILD=cub thrust cudax cccl_c_parallel cccl_c_parallel_v2 python_v2 python_tsan cccl_c_stf python packaging stdpar nvbench_helper
HAS_NON_IGNORED_CHANGES=true
1 change: 1 addition & 0 deletions ci/test/inspect_changes/libcudacxx_thrust.output
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FULL_BUILD=libcudacxx thrust tidy
LITE_BUILD=cub cudax cccl_c_parallel cccl_c_parallel_v2 python_v2 python_tsan cccl_c_stf python packaging stdpar nvbench_helper
HAS_NON_IGNORED_CHANGES=true
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
docs/index.rst
README.md
libcudacxx/include/cuda/std/algorithm
3 changes: 3 additions & 0 deletions ci/test/inspect_changes/mixed_ignored_and_header.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FULL_BUILD=libcudacxx tidy
LITE_BUILD=cub thrust cudax cccl_c_parallel cccl_c_parallel_v2 python_v2 python_tsan cccl_c_stf python packaging stdpar nvbench_helper
HAS_NON_IGNORED_CHANGES=true
1 change: 1 addition & 0 deletions ci/test/inspect_changes/multiple_projects.output
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FULL_BUILD=python_v2 python_tsan python packaging
LITE_BUILD=
HAS_NON_IGNORED_CHANGES=true
1 change: 1 addition & 0 deletions ci/test/inspect_changes/no_changes.output
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FULL_BUILD=
LITE_BUILD=
HAS_NON_IGNORED_CHANGES=false
1 change: 1 addition & 0 deletions ci/test/inspect_changes/packaging_only.output
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
FULL_BUILD=packaging
LITE_BUILD=
HAS_NON_IGNORED_CHANGES=true
2 changes: 1 addition & 1 deletion ci/test/inspect_changes/regenerate_outputs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ for dirty_file in *.dirty_files; do
output_file="${test_name}.output"
echo "Regenerating ${output_file}"
python "${inspect_changes}" --file "${dirty_file}" \
| awk '/^FULL_BUILD=/{print}/^LITE_BUILD=/{print}' > "${output_file}"
| awk '/^FULL_BUILD=/{print}/^LITE_BUILD=/{print}/^HAS_NON_IGNORED_CHANGES=/{print}' > "${output_file}"
done
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci/matx/build_matx.sh
3 changes: 3 additions & 0 deletions ci/test/inspect_changes/third_party_matx_script.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FULL_BUILD=
LITE_BUILD=
HAS_NON_IGNORED_CHANGES=true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/workflows/build-matx.yml
3 changes: 3 additions & 0 deletions ci/test/inspect_changes/third_party_matx_workflow.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FULL_BUILD=
LITE_BUILD=
HAS_NON_IGNORED_CHANGES=true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci/pytorch/build_pytorch.sh
3 changes: 3 additions & 0 deletions ci/test/inspect_changes/third_party_pytorch_script.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FULL_BUILD=
LITE_BUILD=
HAS_NON_IGNORED_CHANGES=true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/workflows/build-pytorch.yml
3 changes: 3 additions & 0 deletions ci/test/inspect_changes/third_party_pytorch_workflow.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FULL_BUILD=
LITE_BUILD=
HAS_NON_IGNORED_CHANGES=true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ci/rapids/rapids-entrypoint.sh
3 changes: 3 additions & 0 deletions ci/test/inspect_changes/third_party_rapids_script.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FULL_BUILD=
LITE_BUILD=
HAS_NON_IGNORED_CHANGES=true
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/workflows/build-rapids.yml
3 changes: 3 additions & 0 deletions ci/test/inspect_changes/third_party_rapids_workflow.output
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FULL_BUILD=
LITE_BUILD=
HAS_NON_IGNORED_CHANGES=true
12 changes: 10 additions & 2 deletions docs/infrastructure/ci/references/change_detection.rst
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ from any project in ``FULL_BUILD`` is added to ``LITE_BUILD``.
Output
------

``inspect_changes.py`` emits two GitHub Actions outputs, each a space-separated
list of ``matrix_project`` values:
``inspect_changes.py`` emits two GitHub Actions outputs containing space-separated
lists of ``matrix_project`` values:
Comment thread
jakezwang marked this conversation as resolved.
Outdated

``FULL_BUILD``
Projects that build and test their full job set.
Expand All @@ -107,6 +107,14 @@ whose project is in ``FULL_BUILD``, then reads the ``pull_request_lite`` section
and keeps only entries whose project is in ``LITE_BUILD``, then concatenates the
two. A project absent from both lists contributes no jobs.

The additional ``HAS_NON_IGNORED_CHANGES`` output is ``true`` if any changed file
survives the global ignore filter, or ``false`` otherwise. The pull-request workflow
uses this when exporting its existing ``matx_enabled``, ``pytorch_enabled``, and
``rapids_enabled`` flags to skip optional builds for documentation-only and other
ignored changes. Their own workflows and build scripts belong to the internal
``third_party`` project, so changes to those files still run third-party tests without
adding CCCL matrix jobs. The existing third-party skip tags continue to apply.

To see the exact lists for any change, run ``inspect_changes.py`` locally:

.. code-block:: bash
Expand Down
Loading