Extract cmake action#485
Conversation
This removes the duplicated code and re-uses the same action.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Pull request overview
This PR extracts the repeated “install CMake + Ninja” logic into a shared composite GitHub Action and updates workflows to reuse it, while also enabling the documentation workflow to run on pull requests (per #484).
Changes:
- Add a composite action at
.github/actions/setup-cmaketo install CMake 4.2.3 + Ninja vialukka/get-cmake. - Replace duplicated CMake setup steps in
build.ymlanddocumentation.ymlwith the new local action. - Trigger
documentation.ymlonpull_requestin addition topushandworkflow_dispatch.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
.github/workflows/documentation.yml |
Adds PR trigger and reuses the shared CMake setup action. |
.github/workflows/build.yml |
Replaces duplicated CMake setup blocks with the shared action in multiple jobs. |
.github/actions/setup-cmake/action.yml |
Introduces a composite action encapsulating CMake/Ninja setup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| on: | ||
| push: | ||
| branches: [master] | ||
| pull_request: | ||
| workflow_dispatch: |
There was a problem hiding this comment.
With the new pull_request trigger, the workflow-level permissions (pages: write, id-token: write) will also apply to PR runs. Consider scoping these elevated permissions more tightly (e.g., job-level permissions only where required), especially since the deploy job already declares pages/id-token explicitly and doesn’t run on PRs.
| with: | ||
| cmakeVersion: 4.2.3 | ||
| ninjaVersion: latest | ||
| - uses: ./.github/actions/setup-cmake |
There was a problem hiding this comment.
This step invokes a local action without a name, so the Actions UI will show a less descriptive default label. Consider adding an explicit name: Setup CMake for clearer logs and easier troubleshooting.
| - uses: ./.github/actions/setup-cmake | |
| - name: Setup CMake | |
| uses: ./.github/actions/setup-cmake |
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - uses: ./.github/actions/setup-cmake |
There was a problem hiding this comment.
This step invokes a local action without a name, so the Actions UI will show a less descriptive default label. Consider adding an explicit name: Setup CMake for clearer logs and easier troubleshooting.
| - uses: ./.github/actions/setup-cmake | |
| - name: Setup CMake | |
| uses: ./.github/actions/setup-cmake |
| uses: lukka/get-cmake@latest | ||
| with: | ||
| cmakeVersion: 4.2.3 | ||
| ninjaVersion: latest |
There was a problem hiding this comment.
uses: lukka/get-cmake@latest makes builds non-reproducible and increases supply-chain risk if the upstream action changes. Prefer pinning to a specific release tag or commit SHA (and consider pinning the Ninja version too) so CI behavior is stable over time.
| uses: lukka/get-cmake@latest | |
| with: | |
| cmakeVersion: 4.2.3 | |
| ninjaVersion: latest | |
| uses: lukka/get-cmake@v3 | |
| with: | |
| cmakeVersion: 4.2.3 | |
| ninjaVersion: 1.11.1 |
Moves apt-get install earlier (before cmake configure) and adds the OpenGL packages needed to satisfy find_package(OpenGL). Also consolidates the two install steps: apt packages up front, pip packages after Python setup. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The native build only produces cute-shaderc (a CLI tool), so all SDL audio, video, input, and platform backends can be turned off to speed up configuration and avoid missing-library errors on the CI runner. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add gh_annotation helper with gh_debug, gh_notice, and gh_warn wrappers that emit ::debug::, ::notice::, and ::warning:: annotations on CI and fall back to plain puts/warn locally. Paths in messages are relative to pwd. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This removes the duplicated code and re-uses the same action.
Adds missing dependencies for CMake build in documentation.
Includes #484