Skip to content

Load setup-cpp from build.yml's own commit - #122

Draft
yaito3014 wants to merge 2 commits into
msvc-toolset-prefixfrom
ci-actions-from-workflow-commit
Draft

yaito3014 wants to merge 2 commits into
msvc-toolset-prefixfrom
ci-actions-from-workflow-commit

Conversation

@yaito3014

@yaito3014 yaito3014 commented Nov 19, 2026 •

Copy link
Copy Markdown
Member

build.yml is a reusable workflow that x4 calls as iris-cpp/iris/.github/workflows/build.yml@main, but it ran ./.github/actions/setup-cpp from the caller's workspace, which the "Copy Local GitHub Actions" step filled from the caller's modules/iris submodule. The workflow and the action it calls therefore came from different iris commits: the workflow from main, the action from whatever commit the caller's submodule points at. Any change to the action's interface, such as the input rename in #120, broke callers until they bumped the submodule.

This replaces that step with a sparse checkout of .github/actions from job.workflow_repository at job.workflow_sha, which identify the commit of the reusable workflow itself rather than the caller's (contexts reference), and runs setup-cpp from there. Callers get the action matching the workflow they call without a submodule bump; the submodule is left to pin only the library.

Stacked on #120; it will be retargeted to main once #120 merges. The companion x4 PR relies on both.

build.yml is called from other repositories (x4 calls it at @main), but
it used ./.github/actions/setup-cpp from the caller's workspace, copied
from the caller's iris submodule. The workflow and the action it calls
therefore came from different iris commits, and any change to their
interface broke callers until they bumped the submodule.

Check out .github/actions from job.workflow_repository at
job.workflow_sha instead, so the action always matches the workflow.
Callers no longer need a submodule bump to pick up CI changes.

actionlint 1.7.12 does not yet know the job.workflow_* properties and
reports them as undefined.
@cppwarningnotifier

Copy link
Copy Markdown
EnvironmentC++23C++26
irisClang22Debug✅success✅success
Release✅success✅success
GCC15Debug✅success✅success
Release✅success✅success
MSVC2026Debug✅success✅success
Release✅success✅success

@saki7 saki7 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I currently have no specific objection regarding this PR's implementation details. I understand the rationale too; dropping fragile @main dependency and sticking with some specific commit is much better without doubts.

Please just make sure the functional changes are minimal, and don't introduce unnecessarily large facility for achieving the goal I originally mentioned. If no design-related concerns emerge, feel free to self-merge.

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