Skip to content

Attempt to speed up Windows CI - #308

Closed
tameware with Copilot wants to merge 7 commits into
developfrom
copilot/windows-build-performance-issue
Closed

Attempt to speed up Windows CI#308
tameware with Copilot wants to merge 7 commits into
developfrom
copilot/windows-build-performance-issue

Conversation

Copilot AI commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Windows CI was repeatedly downloading the Bazel binary via Bazelisk, adding avoidable latency and making runs more sensitive to transient network/DNS failures. This change adds Bazel disk-cache and persists the cache between workflow runs while leaving existing Bazel behavior intact.

  • What changed

    • Added a dedicated Bazelisk cache root in the Windows workflow job env:
      • BAZELISK_HOME: ${{ github.workspace }}\.bazel-cache\bazelisk
    • Added an actions/cache step to restore/save Bazelisk downloads using:
      • key: windows-bazelisk-cache-${{ runner.os }}-${{ hashFiles('.bazelversion') }}
      • restore key prefix by OS for partial reuse
  • Why this keying strategy

    • .bazelversion invalidates cache when Bazel version changes.
    • OS scoping prevents cross-platform cache contamination.
env:
  BAZELISK_HOME: ${{ github.workspace }}\.bazel-cache\bazelisk

- name: Restore Bazelisk cache
  uses: actions/cache@v4
  with:
    path: ${{ env.BAZELISK_HOME }}
    key: windows-bazelisk-cache-${{ runner.os }}-${{ hashFiles('.bazelversion') }}
    restore-keys: |
      windows-bazelisk-cache-${{ runner.os }}-

Also changes the Windows CI test/build target scope and adds profile capture/analysis.

Copilot AI and others added 2 commits August 10, 2026 16:44
Co-authored-by: tameware <4573152+tameware@users.noreply.github.com>
Co-authored-by: tameware <4573152+tameware@users.noreply.github.com>
Copilot AI changed the title Speed up Windows CI by caching Bazelisk downloads Windows CI: cache Bazelisk runtime to reduce cold-start fetch overhead Aug 10, 2026
Copilot AI requested a review from tameware August 10, 2026 21:38
@tameware
tameware requested a lite review from Copilot August 10, 2026 21:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Windows CI workflow to reduce cold-start latency and improve reliability by reusing cached Bazel/Bazelisk artifacts across runs, while also reshaping the Windows CI build/test flow and collecting Bazel profiles for analysis.

Changes:

  • Persist Bazelisk’s downloaded Bazel binaries across workflow runs via BAZELISK_HOME + actions/cache.
  • Add a Bazel disk cache restore/save step and pass --disk_cache to fetch/test/build commands.
  • Split Windows CI into fastbuild test coverage + a narrow --config=opt smoke build, and emit/upload a Bazel profile + analysis output.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
python/tests/ci_windows_cppopts_test.py Updates assertions to match the new Windows CI command structure (fastbuild tests, limited opt build, profile emission, cache usage).
.github/workflows/ci_windows.yml Adds Bazelisk + Bazel disk caching, adjusts Windows CI target scope and compilation modes, and captures/analyzes Bazel profiles.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/ci_windows.yml Outdated
Comment thread .github/workflows/ci_windows.yml Outdated
Comment thread .github/workflows/ci_windows.yml Outdated
tameware and others added 2 commits August 10, 2026 22:52
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…argets as separate args

Previously, $arr passed to a native command in PowerShell joined array
elements into a single space-separated string, so Bazel received the
full target list as one invalid package name. Switching to @arr splatting
passes each element as a distinct argument across all PowerShell versions.

Also use -split '\s+' with a non-empty filter to tolerate any whitespace
variation in the env var value.

Co-authored-by: tameware <4573152+tameware@users.noreply.github.com>
Co-authored-by: tameware <4573152+tameware@users.noreply.github.com>
Co-authored-by: tameware <4573152+tameware@users.noreply.github.com>
Co-authored-by: tameware <4573152+tameware@users.noreply.github.com>
@tameware tameware changed the title Windows CI: cache Bazelisk runtime to reduce cold-start fetch overhead Attempt to speed up Windows CI Aug 11, 2026
@tameware
tameware requested a review from zzcgumn August 11, 2026 07:42
@zzcgumn zzcgumn added this to the v3.2.0 milestone Aug 11, 2026
@tameware

Copy link
Copy Markdown
Collaborator

@zzcgumn, the Windows CI was sometimes timing out at 20 minutes. I asked Copilot to try to make it faster. This is what it came up with, but I'm not certain it's faster! I can ask Copilot for additional speedups.

@zzcgumn

zzcgumn commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Interesting idea but I suggest we leave for 3.2.0. I am thinking that we want to check if similar caching schemes can speed Linux and macOS CI runs too.

@tameware

Copy link
Copy Markdown
Collaborator

Postponed for now. Will consider for v3.2.

@tameware tameware closed this Aug 11, 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.

4 participants