Skip to content

ci: build cpp only when cpp changed#1140

Merged
doodlum merged 1 commit into
community-shaders:devfrom
alandtse:smart_build
Jun 14, 2025
Merged

ci: build cpp only when cpp changed#1140
doodlum merged 1 commit into
community-shaders:devfrom
alandtse:smart_build

Conversation

@alandtse
Copy link
Copy Markdown
Collaborator

@alandtse alandtse commented Jun 14, 2025

Summary by CodeRabbit

  • Chores
    • Improved workflow efficiency by adding a new check that only triggers builds for pull requests with relevant changes.
    • Build process now skips unnecessary runs when no C++ or build-related files are modified in a pull request.

Copilot AI review requested due to automatic review settings June 14, 2025 02:39
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 14, 2025

"""

Walkthrough

A new check-changes job was introduced in the GitHub Actions workflow to detect relevant file changes in pull requests. The build job was updated to depend on this new job and now only runs if certain files have changed or if the event is not a pull_request_target. No other workflow steps were changed.

Changes

File(s) Change Summary
.github/workflows/build.yaml Added check-changes job to detect file changes; updated build job to depend on its outputs.

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)
Loading

Suggested reviewers

  • jiayev
  • doodlum
    """

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b8fd4ed and 5e32d57.

📒 Files selected for processing (1)
  • .github/workflows/build.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/build.yaml

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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: |

Comment thread .github/workflows/build.yaml
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
.github/workflows/build.yaml (3)

38-41: Unused hlsl-should-build output.

You’re setting hlsl-should-build but 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

📥 Commits

Reviewing files that changed from the base of the PR and between 9885661 and b8fd4ed.

📒 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-changes job correctly detects C++, build config, and HLSL modifications only on pull_request_target events and exposes should-build accordingly.


75-76: Build job now correctly depends on change detection.

The build job will wait for check-changes and only run on non-draft PRs when should-build is true (or on non-PR_TARGET events), matching the intended CI optimization.

@doodlum doodlum merged commit fe5b7c4 into community-shaders:dev Jun 14, 2025
6 checks passed
alandtse added a commit that referenced this pull request Jun 20, 2025
davo0411 pushed a commit to davo0411/skyrim-community-shaders that referenced this pull request Jun 21, 2025
alandtse added a commit to alandtse/open-shaders that referenced this pull request Jul 20, 2025
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.

3 participants