Skip to content

ci: use pre-installed VS 2022, skip VS 2026 download#2395

Draft
doodlum wants to merge 2 commits into
devfrom
perf/vs2022-ci-toolchain
Draft

ci: use pre-installed VS 2022, skip VS 2026 download#2395
doodlum wants to merge 2 commits into
devfrom
perf/vs2022-ci-toolchain

Conversation

@doodlum
Copy link
Copy Markdown
Collaborator

@doodlum doodlum commented May 22, 2026

Summary

windows-2025 GitHub-hosted runners ship VS 2022 Enterprise pre-installed. Every CI job currently ignores that and downloads + installs VS 2026 Build Tools from scratch on each run (~8–12 min network + installer time). This PR removes that download step entirely and switches to the ALL-VS2022 cmake preset (VS 17 2022 generator), which is already defined in CMakePresets.json.

Changes

File Change
.github/actions/setup-build-environment/action.yaml Remove Install Visual Studio 2026 Build Tools step (20-line PowerShell download/install); update comment
.github/workflows/_shared-build.yaml Switch cpp-build matrix and shader-unit-tests from ALL / build/ALL to ALL-VS2022 / build/ALL-VS2022

The ALL-VS2022 configure preset and build preset were added to CMakePresets.json previously and use "Visual Studio 17 2022" as the generator.


Benchmarks

Note on workflow change testing: GitHub's pull_request_target trigger (used for security with fork PRs) always runs workflow files from the base branch, not the PR head. Changes to .github/workflows/ and .github/actions/ cannot be exercised by their own PR's CI — they take effect on the first build after merge. This is the same limitation that applies to all CI-only PRs in this repo (see comment in pr-checks.yaml lines 4–10 and 47–53). After-timings below will be measured from the next CI run on dev after this merges.

Before (measured from recent CI on dev — VS 2026 install on every job)

Job PR #2386 PR #2380
Build plugin and addons (vs2026) 36m 01s 42m 51s (cold cache)
Run Shader Unit Tests 11m 34s skipped

Expected after (VS 2026 download removed; VS 2022 pre-installed on runner)

The VS 2026 installer step runs at the start of both cpp-build and shader-unit-tests. Based on installer timing in the job logs, it accounts for roughly 8–12 minutes of each job's wall-clock time.

Job Expected saving Estimated new time
Build plugin and addons (vs2022) ~8–12 min ~24–30 min
Run Shader Unit Tests ~8–12 min ~2–4 min
Total per full CI run ~16–24 min

After (to be filled once CI runs post-merge)

Job Time
Build plugin and addons (vs2022)
Run Shader Unit Tests

Compatibility notes

  • ALL-VS2022 inherits from skyrim which inherits msvc, but overrides the generator to "Visual Studio 17 2022". The stale-cache detection in setup-build-environment validates the generator, so cached builds from ALL / VS 2026 will not be reused incorrectly.
  • The VS 2026-specific ICE workaround in tests/shaders/CMakeLists.txt (MSVC_VERSION GREATER_EQUAL 1950) does not trigger for VS 2022 (~1930s). Shader tests compile normally.
  • Release builds go through _shared-build.yaml via release-build.yaml, so they also benefit.

Generated by Claude Code

windows-2025 GitHub runners ship VS 2022 Enterprise out of the box.
The setup-build-environment action was downloading and installing VS
2026 Build Tools on every job invocation (~8-12 min), despite the
runner already having a working C++ toolchain available.

Remove the VS 2026 download step and switch CI to the ALL-VS2022
cmake preset (Visual Studio 17 2022 generator), which is already
defined in CMakePresets.json. TheMrMilchmann/setup-msvc-dev
auto-detects the highest available VS installation on the runner.

Affected jobs: cpp-build (~8-12 min saving) and shader-unit-tests
(~8-12 min saving). Both jobs pay the install cost today; neither
needs VS 2026 specifically.
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8fa39d80-3432-4dae-9775-f781ed522c58

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch perf/vs2022-ci-toolchain

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Allows testing workflow and action file changes on a feature branch
without merging to dev first.

workflow_dispatch resolves all files (including .github/actions/*)
from the selected ref, unlike pull_request_target which always uses
the base branch. Trigger via: Actions → Manual CI Test → Run workflow
→ select branch.
@SkrubbySkrubInAShrub SkrubbySkrubInAShrub changed the title perf(ci): use pre-installed VS 2022, skip VS 2026 download ci: use pre-installed VS 2022, skip VS 2026 download May 22, 2026
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