ci: build cpp only when cpp changed#1140
Conversation
|
""" WalkthroughA new Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub Actions
participant check-changes job
participant build job
GitHub Actions->>check-changes job: Run on pull_request_target
check-changes job->>GitHub Actions: Output should-build, hlsl-should-build
GitHub Actions->>build job: Run if not draft and (not pull_request_target or should-build)
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a CI optimization that ensures the C++ build is only triggered when C++‐related files are modified.
- Added a new "check-changes" job to detect changes in C++ files (and HLSL files separately).
- Updated the build job to depend on the check-changes job and conditionally trigger based on file change outputs.
Comments suppressed due to low confidence (1)
.github/workflows/build.yaml:50
- [nitpick] Consider adding inline comments to the 'files_yaml' section to explain the purpose behind the inclusion and exclusion patterns for clarity and future maintainability.
files_yaml: |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (3)
.github/workflows/build.yaml (3)
38-41: Unusedhlsl-should-buildoutput.You’re setting
hlsl-should-buildbut not consuming it in any subsequent job. Either wire it into an HLSL-specific build step or remove this output to reduce confusion.
45-45: Remove trailing whitespace.YAML linter flagged a trailing space on this line. Please trim it to keep the file clean.
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 45-45: trailing spaces
(trailing-spaces)
73-73: Remove trailing whitespace.Another trailing space here triggers a linter warning—please delete it.
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 73-73: trailing spaces
(trailing-spaces)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/build.yaml(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/build.yaml
[error] 45-45: trailing spaces
(trailing-spaces)
[error] 73-73: trailing spaces
(trailing-spaces)
🔇 Additional comments (2)
.github/workflows/build.yaml (2)
35-41: Check-changes job effectively gates builds on relevant file types.The new
check-changesjob correctly detects C++, build config, and HLSL modifications only onpull_request_targetevents and exposesshould-buildaccordingly.
75-76: Build job now correctly depends on change detection.The
buildjob will wait forcheck-changesand only run on non-draft PRs whenshould-buildis true (or on non-PR_TARGET events), matching the intended CI optimization.
Summary by CodeRabbit