ci: add automated wiki buffer documentation workflow#1659
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. 📝 WalkthroughWalkthroughAdds a reusable GitHub Actions composite action "Prepare Shaders", updates the main build workflow to use it for shader validation, and adds a workflow that generates and publishes buffer documentation to the repository wiki. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Trigger
participant Workflow as Update Buffers Wiki Workflow
participant Action as Prepare-Shaders Action
participant MSVC as MSVC Env
participant CMake as CMake / vcpkg
participant Python as Python + hlslkit
participant Scanner as hlslkit-buffer-scan
participant Wiki as GitHub Wiki
Trigger->>Workflow: push to dev / manual dispatch
Workflow->>Workflow: checkout repo + submodules
Workflow->>Action: run prepare-shaders (cache-key-suffix: wiki)
Action->>MSVC: acquire MSVC environment
MSVC-->>Action: MSVC available
Action->>Action: detect MSVC version (dummy compile)
Action->>CMake: setup vcpkg, restore/cache, run prepare_shaders target
CMake-->>Action: prepare_shaders built
Action->>Python: setup Python 3.11, pip install hlslkit
Python-->>Action: hlslkit available
Workflow->>Scanner: run hlslkit-buffer-scan -> wiki-content/Buffers.md
Scanner-->>Workflow: Buffers.md (validated non-empty)
Workflow->>Wiki: upload wiki-content via wiki-action
Wiki-->>Trigger: wiki updated
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧠 Learnings (4)📓 Common learnings📚 Learning: 2025-08-17T18:37:35.839ZApplied to files:
📚 Learning: 2025-08-17T18:37:35.839ZApplied to files:
📚 Learning: 2025-08-17T18:37:35.839ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (4)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 actionlint (1.7.9).github/workflows/build.yamlcould not read ".github/workflows/build.yaml": open .github/workflows/build.yaml: no such file or directory .github/workflows/update-buffers-wiki.yamlcould not read ".github/workflows/update-buffers-wiki.yaml": open .github/workflows/update-buffers-wiki.yaml: no such file or directory 🔧 YAMLlint (1.37.1).github/actions/prepare-shaders/action.yml[Errno 2] No such file or directory: '.github/actions/prepare-shaders/action.yml' .github/workflows/build.yaml[Errno 2] No such file or directory: '.github/workflows/build.yaml' .github/workflows/update-buffers-wiki.yaml[Errno 2] No such file or directory: '.github/workflows/update-buffers-wiki.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. Comment |
There was a problem hiding this comment.
Pull request overview
This PR introduces a reusable composite action for shader preparation and adds automated wiki documentation for buffer register usage. The changes eliminate code duplication in CI workflows and enable automatic updates to the project wiki when shader files are modified on the dev branch.
- Extracted common shader preparation steps into a reusable composite action to reduce workflow duplication
- Added automated buffer documentation workflow that scans compiled shaders and updates the wiki with register usage
- Refactored shader-validation job to use the new prepare-shaders action, removing ~65 lines of duplicated code
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/actions/prepare-shaders/action.yml |
New composite action that encapsulates MSVC setup, vcpkg installation, CMake build caching, shader preparation, and hlslkit installation |
.github/workflows/update-buffers-wiki.yaml |
New workflow that triggers on shader changes to dev branch, runs buffer scanning, and automatically updates the wiki with buffer register documentation |
.github/workflows/build.yaml |
Refactored to use the new prepare-shaders composite action, replacing inline shader preparation steps with a single action call |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (4)
.github/workflows/update-buffers-wiki.yaml (1)
36-40: Consider adding error handling for buffer scan output.If
hlslkit-buffer-scanfails or produces empty output, the workflow will still attempt to upload potentially invalid content to the wiki. Consider adding validation.🔎 Proposed improvement
- name: Scan buffer usage run: | cd build/ALL/aio/Shaders - hlslkit-buffer-scan > ../../../../wiki-content/Buffers.md + hlslkit-buffer-scan > ../../../../wiki-content/Buffers.md + if [ ! -s ../../../../wiki-content/Buffers.md ]; then + echo "Error: Buffer scan produced empty output" >&2 + exit 1 + fi shell: bash.github/workflows/build.yaml (1)
141-200: Consider extracting MSVC version detection to avoid duplication.The
cpp-buildjob contains MSVC version detection logic (lines 141-200) that's similar to what's in theprepare-shadersaction. Whilecpp-buildneeds a full build rather than just shader preparation, the version detection logic could potentially be shared.This is acceptable for now since
cpp-buildhas different requirements (full build vs. shader-only), but consider extracting just the MSVC version detection into a smaller reusable action if this pattern grows..github/actions/prepare-shaders/action.yml (2)
16-16: Consider specifying the architecture explicitly.The
cpp-buildjob usesarch: x64when invokingilammy/msvc-dev-cmd@v1, but this action doesn't specify an architecture. This could lead to inconsistent behavior if the default architecture differs across runner configurations.🔎 Proposed fix
- uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x64
48-54: Cleanup happens after potential failure, leaving dummy.cpp behind.If
throwis executed on line 51, theRemove-Itemon line 54 won't run, leavingdummy.cppin the workspace. Consider using try/finally or moving cleanup earlier.🔎 Proposed fix using try/finally
if ($version) { Add-Content -Path $env:GITHUB_OUTPUT -Value "version=$version" -Encoding UTF8 + Remove-Item "dummy.cpp" -ErrorAction SilentlyContinue } else { + Remove-Item "dummy.cpp" -ErrorAction SilentlyContinue throw "MSVC version not found in output" } - - Remove-Item "dummy.cpp" -ErrorAction SilentlyContinue
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/actions/prepare-shaders/action.yml.github/workflows/build.yaml.github/workflows/update-buffers-wiki.yaml
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: alandtse
Repo: doodlum/skyrim-community-shaders PR: 0
File: :0-0
Timestamp: 2025-06-24T07:17:36.604Z
Learning: When reviewing PRs, always clarify the scope if there are multiple related features or dependencies. WeatherPicker was a separate PR that was already merged, while this PR focuses specifically on WetnessEffects climate preset system enhancements.
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: On Linux/WSL, do not attempt to build or validate shaders; limit work to code review, docs, and Python tooling
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: On Linux/WSL, do not attempt to build or validate shaders; limit work to code review, docs, and Python tooling
Applied to files:
.github/actions/prepare-shaders/action.yml.github/workflows/build.yaml
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: Applies to features/*/Shaders/**/*.{hlsl,hlsli,fx,fxh} : Place all feature shaders under features/YourFeature/Shaders/
Applied to files:
.github/workflows/build.yaml
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: Applies to features/*/Shaders/**/*.{hlsl,hlsli,fx,fxh} : Avoid GPU register/buffer conflicts in HLSL; verify register usage (e.g., with hlslkit buffer scanning)
Applied to files:
.github/workflows/build.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
- GitHub Check: Validate shader compilation (VR, .github/configs/shader-validation-vr.yaml)
- GitHub Check: Build plugin and addons
- GitHub Check: Validate shader compilation (Flatrim, .github/configs/shader-validation.yaml)
- GitHub Check: Agent
🔇 Additional comments (4)
.github/workflows/update-buffers-wiki.yaml (1)
1-12: Well-structured trigger configuration.The workflow correctly triggers on shader file changes pushed to
devand supports manual dispatch. The path filters are appropriately scoped to shader files..github/workflows/build.yaml (1)
329-333: Good refactoring to use the composite action.The shader-validation job now properly delegates to the
prepare-shadersaction, reducing duplication and centralizing the shader preparation logic. The cache key suffix correctly includes the matrix config name for proper cache isolation..github/actions/prepare-shaders/action.yml (2)
1-102: Overall: Well-structured composite action for shader preparation.The action successfully centralizes shader preparation logic, including MSVC setup, caching, and hlslkit installation. The design enables reuse across the shader-validation job and the new wiki update workflow.
88-93: No action needed. The buildPresetAdditionalArgs syntax is correct.The format
"['--target prepare_shaders']"matches the expected syntax documented forlukka/run-cmake@v10, which accepts a string containing a JSON array (e.g.,"['--config Release']").
|
✅ A pre-release build is available for this PR: |
There was a problem hiding this comment.
Actionable comments posted: 0
♻️ Duplicate comments (1)
.github/workflows/update-buffers-wiki.yaml (1)
36-60: Thehlslkit-buffer-scancommand is missing the--features-dirflag.As noted in an earlier review, running
hlslkit-buffer-scanwithout the--features-dirargument may not produce proper feature-level buffer attribution. The documented usage pattern suggests including--features-dir ../../../../featureswhen running from thebuild/ALL/aio/Shadersdirectory.Based on learnings, buffer register conflicts should be tracked with proper feature attribution.
🔎 Suggested fix
- if ! hlslkit-buffer-scan > "${OUTPUT_PATH}"; then + if ! hlslkit-buffer-scan --features-dir ../../../../features > "${OUTPUT_PATH}"; then echo "Error: hlslkit-buffer-scan failed to complete successfully." >&2 exit 1 fi
🧹 Nitpick comments (1)
.github/workflows/update-buffers-wiki.yaml (1)
40-42: Consider using absolute paths for improved robustness.The relative path construction (
../../../../wiki-content/Buffers.md) is fragile and depends on the precise directory depth. If the build structure changes, this will break silently.🔎 Suggested refactor
SHADER_DIR="build/ALL/aio/Shaders" OUTPUT_REL_PATH="wiki-content/Buffers.md" - OUTPUT_PATH="../../../../${OUTPUT_REL_PATH}" + OUTPUT_PATH="${GITHUB_WORKSPACE}/${OUTPUT_REL_PATH}" if [ ! -d "${SHADER_DIR}" ]; then
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/update-buffers-wiki.yaml
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: On Linux/WSL, do not attempt to build or validate shaders; limit work to code review, docs, and Python tooling
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: Applies to features/*/Shaders/**/*.{hlsl,hlsli,fx,fxh} : Avoid GPU register/buffer conflicts in HLSL; verify register usage (e.g., with hlslkit buffer scanning)
Applied to files:
.github/workflows/update-buffers-wiki.yaml
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: On Linux/WSL, do not attempt to build or validate shaders; limit work to code review, docs, and Python tooling
Applied to files:
.github/workflows/update-buffers-wiki.yaml
📚 Learning: 2025-08-17T18:37:35.839Z
Learnt from: CR
Repo: doodlum/skyrim-community-shaders PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-17T18:37:35.839Z
Learning: Applies to features/*/Shaders/**/*.{hlsl,hlsli,fx,fxh} : Place all feature shaders under features/YourFeature/Shaders/
Applied to files:
.github/workflows/update-buffers-wiki.yaml
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Validate shader compilation (Flatrim, .github/configs/shader-validation.yaml)
- GitHub Check: Validate shader compilation (VR, .github/configs/shader-validation-vr.yaml)
- GitHub Check: Build plugin and addons
🔇 Additional comments (3)
.github/workflows/update-buffers-wiki.yaml (3)
3-12: LGTM! Trigger configuration is well-structured.The workflow correctly triggers on shader file changes in both feature and package directories, with manual dispatch for testing.
14-15: LGTM! Permissions are correctly configured.The
contents: writepermission is appropriate for wiki updates via the github-wiki-action.
62-66: LGTM! Wiki upload configuration is correct.The action version has been updated to v5 as suggested in earlier feedback, and the configuration properly references the generated wiki content directory.
davo0411
left a comment
There was a problem hiding this comment.
looks good, was sorely needed.
if tested and working i am happy to merge
- Create reusable prepare-shaders composite action to eliminate duplication - Add update-buffers-wiki workflow to automatically update wiki on dev pushes - Refactor shader-validation job to use prepare-shaders action - Use Andrew-Chen-Wang/github-wiki-action for wiki updates - Run hlslkit-buffer-scan to generate buffer register usage documentation The new workflow triggers on shader changes to dev branch and updates https://github.com/doodlum/skyrim-community-shaders/wiki/Buffers with a comprehensive table of all buffer register assignments, types, and feature usage. Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> # Conflicts: # .github/workflows/build.yaml # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # # interactive rebase in progress; onto 8b8b375 # Last command done (1 command done): # pick a379eed # ci: add automated wiki buffer documentation workflow # Next commands to do (2 remaining commands): # pick 7b6f4f6 # chore: address ai comments # pick b4311df # style: pre-commit # You are currently rebasing branch 'buffer_scan_ci' on '8b8b375d'. # # Changes to be committed: # new file: .github/actions/prepare-shaders/action.yml # modified: .github/workflows/build.yaml # new file: .github/workflows/update-buffers-wiki.yaml # # Changes not staged for commit: # modified: extern/CommonLibSSE-NG (new commits, untracked content) # # Untracked files: # AUTO_GENERATED_COMPATIBILITY.md # extern/NVAPI/ # tools/feature_compatibility_matrix.sh #
b4311df to
e8ea0ab
Compare
The new workflow triggers on shader changes to dev branch and updates https://github.com/doodlum/skyrim-community-shaders/wiki/Buffers with a comprehensive table of all buffer register assignments, types, and feature usage.
Summary by CodeRabbit
New Features
Chores
✏️ Tip: You can customize this high-level summary in your review settings.