Skip to content

ci: cache with msvc key#1172

Merged
alandtse merged 6 commits into
community-shaders:devfrom
alandtse:msvc_key
Jun 22, 2025
Merged

ci: cache with msvc key#1172
alandtse merged 6 commits into
community-shaders:devfrom
alandtse:msvc_key

Conversation

@alandtse
Copy link
Copy Markdown
Collaborator

@alandtse alandtse commented Jun 22, 2025

Summary by CodeRabbit

  • Chores
    • Improved build cache handling to better recognize compiler versions, increasing build efficiency.
    • Enhanced error detection during compiler version extraction for more reliable build processes.
    • Standardized and modularized build and validation workflows for improved maintainability and consistency.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 22, 2025

"""

Walkthrough

The GitHub Actions workflow was refactored to use YAML anchors for reusable steps and configurations. MSVC compiler version extraction was enhanced with a PowerShell script that applies multiple regex patterns, saving the version as a step output. This version is incorporated into cache keys for both C++ build and shader validation jobs, improving cache accuracy and maintainability.

Changes

Files/Paths Change Summary
.github/workflows/build.yaml Introduced YAML anchors for reusable steps (MSVC version extraction, cache cleanup, job definitions, setup steps, build); enhanced MSVC version extraction with robust PowerShell parsing using multiple regexes; integrated MSVC version into cache keys and restore keys for C++ build and shader validation jobs; refactored jobs to use anchors, consolidating permissions and runner specs.

Sequence Diagram(s)

sequenceDiagram
    participant GitHub Actions
    participant PowerShell
    participant cl.exe
    participant Cache

    GitHub Actions->>PowerShell: Run cl.exe /Bv to get MSVC version
    PowerShell->>cl.exe: Execute version info command
    cl.exe-->>PowerShell: Return version output
    PowerShell->>GitHub Actions: Parse output with multiple regexes, set MSVC version output or error
    GitHub Actions->>Cache: Use MSVC version output in cache keys for restore and save
    GitHub Actions->>Build Steps: Continue build with updated cache keys
Loading

Possibly related PRs

  • ci: add checks to build #1170: Refactors MSVC version extraction and cache cleanup in GitHub Actions workflow, closely related to this PR’s enhancements and YAML anchor usage.
  • ci: always run cpp-build #1149: Introduces initial MSVC version extraction and caching improvements in GitHub Actions workflow, foundational to this PR’s further refinements.
  • ci: add hlsl validation #1145: Adds a new shader-validation job and related configuration; related at workflow level but does not overlap with MSVC version extraction logic.

Suggested reviewers

  • doodlum

Poem

🐇 In workflows deep where builds reside,
Anchors bind steps side by side.
PowerShell hunts the MSVC clue,
Regex patterns parse it true.
Cache keys dance with version’s song,
Builds run smooth and swift along!
🥕✨
"""


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 213e515 and af43433.

📒 Files selected for processing (1)
  • .github/workflows/build.yaml (4 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.

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

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

♻️ Duplicate comments (1)
.github/workflows/build.yaml (1)

248-260: Ensure output encoding for GITHUB_OUTPUT in shader-validation
Mirror the cpp-build fix: switch to Add-Content or specify UTF-8 encoding when appending to GITHUB_OUTPUT.

- echo "version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append
+ Add-Content -Path $env:GITHUB_OUTPUT -Value "version=$version" -Encoding UTF8
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7ab9669 and 3fbc806.

📒 Files selected for processing (1)
  • .github/workflows/build.yaml (4 hunks)
🔇 Additional comments (2)
.github/workflows/build.yaml (2)

149-155: Cache key includes MSVC version
Good enhancement: the cache key now factors in the compiler version and suffix, improving cache validity across compiler updates. Fallback keys are well structured and cover suffix/no-suffix scenarios.


273-279: Cache key sensitivity for shader-validation
Including both MSVC version and matrix config ensures separate caches per shader config. The fallback keys mirror the cpp-build job correctly.

Comment thread .github/workflows/build.yaml
@alandtse alandtse marked this pull request as draft June 22, 2025 03:06
@alandtse
Copy link
Copy Markdown
Collaborator Author

Going to draft so the rabbit can rest. Testing in my branch but it's a long iteration between tests.

@alandtse alandtse marked this pull request as ready for review June 22, 2025 03:58
@alandtse alandtse merged commit 11f4b15 into community-shaders:dev Jun 22, 2025
4 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Jun 22, 2025
soda3000 pushed a commit to soda3000/skyrim-community-shaders that referenced this pull request Jun 22, 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.

2 participants