Visitar URL original
ci: speed up the Windows build by brandonroberts · Pull Request #2397 · analogjs/analog · GitHub
Skip to content

ci: speed up the Windows build - #2397

Merged
brandonroberts merged 3 commits into
betafrom
ci/speed-up-build-windows
Jun 30, 2026
Merged

brandonroberts merged 3 commits into
betafrom
ci/speed-up-build-windows

Conversation

@brandonroberts

Copy link
Copy Markdown
Member

PR Checklist

The build-windows job is the long pole of the PR pipeline (~12m). This scopes it to what it actually verifies and moves comprehensive Windows coverage to a nightly run.

Closes #

Affected scope

  • Primary scope: ci
  • Secondary scopes: —

Recommended merge strategy for maintainer [optional]

  • Squash merge
  • Rebase merge
  • Other

What is the new behavior?

Measured on a recent run, build-windows spent 9m33s of its ~12m building 20 projects serially (run-many --target build --all --parallel=1), even though the Verify step only checks blog-app's output.

On every PR (ci.yml):

  • Scoped the build to pnpm exec nx build blog-app — 6 build tasks (blog-app + content/platform/router/vite-plugin-angular/vite-plugin-nitro) instead of 20, and no longer forced serial.
  • Added the pnpm cache step (actions/setup-node cache: 'pnpm') that the coordinator job already uses, to trim the ~1m52s install.
  • --skip-nx-cache so the job genuinely compiles on Windows. Nx's cache hash is OS-independent, so without it Windows could restore the linux agents' artifacts and never exercise the Windows build path — defeating the smoke test.

Nightly (ci-windows-full.yml, new):

  • The broad --all Windows build now runs on a nightly schedule (plus workflow_dispatch), off the per-PR hot path, where the extra coverage is worth the latency.

Net: PRs get a fast, real Windows smoke build of a representative app; "does everything compile on Windows" runs nightly.

Test plan

  • nx format:check (workflow YAML formatted, both files parse)
  • pnpm build
  • pnpm test
  • Manual verification

Validated the task-count reduction locally (nx build blog-app = 6 build tasks vs run-many --all = 20) and that both workflow files parse. The actual Windows wall-clock improvement will be confirmed by this PR's build-windows run.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

CI-infra only; no package or runtime code changes. The nightly workflow can also be triggered manually via the Actions "Run workflow" button.

🤖 Generated with Claude Code

brandonroberts and others added 3 commits June 30, 2026 17:29
The Windows smoke job built all 20 projects serially but Verify only checks
blog-app's output. Scope it to `nx build blog-app` (6 build tasks: blog-app +
content/platform/router/vite-plugin-angular/vite-plugin-nitro) and add the
pnpm cache step the coordinator already uses.

Use `--skip-nx-cache` so the build actually compiles on Windows: Nx's cache
hash is OS-independent, so otherwise Windows could restore the linux agents'
artifacts and never exercise the Windows build path, defeating the smoke test.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014hp2ibFmxCr2asbMcEvZJA
Move the comprehensive `--all` Windows build off the per-PR path into a
dedicated workflow triggered on a nightly schedule (plus manual dispatch).
PRs keep the fast scoped blog-app smoke build; broad Windows coverage runs
nightly where latency matters less.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014hp2ibFmxCr2asbMcEvZJA
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014hp2ibFmxCr2asbMcEvZJA
@netlify

netlify Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for analog-docs ready!

Name Link
🔨 Latest commit f0ed28f
🔍 Latest deploy log https://app.netlify.com/projects/analog-docs/deploys/6a44449d89697c00083daa97
😎 Deploy Preview https://deploy-preview-2397--analog-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for analog-blog ready!

Name Link
🔨 Latest commit f0ed28f
🔍 Latest deploy log https://app.netlify.com/projects/analog-blog/deploys/6a44449d1e90d70008359ced
😎 Deploy Preview https://deploy-preview-2397--analog-blog.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for analog-app ready!

Name Link
🔨 Latest commit f0ed28f
🔍 Latest deploy log https://app.netlify.com/projects/analog-app/deploys/6a44449da6151600070a0064
😎 Deploy Preview https://deploy-preview-2397--analog-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the scope:ci GitHub workflow changes label Jun 30, 2026
@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds a new GitHub Actions workflow, ci-windows-full.yml, that runs a nightly (and manually triggered) full Windows build across all Nx projects except astro-app, verifying a build artifact at the end. It also updates the existing ci.yml Windows smoke build job: revised comments clarify scope and cache rationale, and the build step is changed to use pnpm-cached Node setup, a frozen-lockfile install, and nx build blog-app --skip-nx-cache instead of pnpm build.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows Conventional Commit style and accurately summarizes the CI Windows build changes.
Description check ✅ Passed The description clearly matches the Windows CI scoping and nightly full-build workflow changes.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

Comment on lines +23 to +42
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
- run: corepack enable
- uses: actions/setup-node@v3
with:
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Install
run: pnpm install --frozen-lockfile --prefer-offline
# `--skip-nx-cache` forces an actual Windows compile rather than restoring
# the OS-independent cache the linux agents populated, so this genuinely
# exercises the build on Windows. Mirrors the old `pnpm build` filters.
- name: Build
run: pnpm exec nx run-many --target build --all --parallel=1 --exclude=astro-app --skip-nx-cache
- name: Verify
run: more dist\apps\blog-app\analog\public\index.html
@nx-cloud

nx-cloud Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit f0ed28f

Command Status Duration Result
nx run-many --target e2e --projects=analog-app-... ✅ Succeeded <1s View ↗
nx run-many --target test ✅ Succeeded 21s View ↗
nx run-many --target build --all --parallel=1 -... ✅ Succeeded 4m 24s View ↗
nx run-many --target lint --all --exclude=conte... ✅ Succeeded <1s View ↗
nx-cloud record -- pnpm prettier:check ✅ Succeeded 10s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-06-30 22:41:11 UTC

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (3)
.github/workflows/ci-windows-full.yml (3)

23-25: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Add an explicit permissions block and persist-credentials: false.

Neither the workflow nor the build-windows-full job sets a permissions block (CodeQL flags this for the whole job), so GITHUB_TOKEN defaults to broad permissions it doesn't need for a pure build job. The checkout step also doesn't set persist-credentials: false (zizmor's artipacked warning), leaving the token persisted in the local git config for the rest of the job.

🔒 Proposed fix
 jobs:
   build-windows-full:
     runs-on: windows-latest
+    permissions:
+      contents: read
     steps:
-      - uses: actions/checkout@v3
+      - uses: actions/checkout@v4
+        with:
+          persist-credentials: false
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci-windows-full.yml around lines 23 - 25, The
build-windows-full job currently relies on the default broad GITHUB_TOKEN scope
and keeps checkout credentials persisted. Add an explicit permissions block to
the workflow or job with the minimum required access for this build, and update
the checkout step to disable credential persistence. Use the build-windows-full
job and its actions/checkout@v3 step as the place to make these changes.

Source: Linters/SAST tools


29-29: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Corepack version isn't pinned here, unlike the main job.

The main job pins corepack@0.31.0 before enabling it, but this new job (and build-windows in ci.yml) just runs bare corepack enable. Across OS planes this can silently resolve to a different corepack version, undermining reproducibility of the "real Windows build" this job exists for.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci-windows-full.yml at line 29, The Windows workflow is
enabling Corepack without pinning the version, which can make the build
non-reproducible across OS planes. Update the new job’s Corepack setup to match
the pinned approach used in the main job, and apply the same change to the
build-windows job in ci.yml; use the existing corepack enable step as the place
to swap in the pinned corepack@0.31.0 invocation.

17-19: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Concurrency group keyed on sha won't dedupe across separate nightly runs.

This workflow only fires on schedule/workflow_dispatch, so github.event.number is always empty and the group always falls back to github.sha. That means two manual dispatches on the same commit will cancel each other, but a nightly cron run and a same-day manual dispatch on a different commit (or an overrunning previous nightly run) won't be deduplicated at all. For a singleton "full build" workflow, a fixed group name better expresses the intent of allowing only one full Windows build at a time.

 concurrency:
-  group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
+  group: ${{ github.workflow }}
   cancel-in-progress: true
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci-windows-full.yml around lines 17 - 19, The concurrency
settings for this full Windows workflow are using github.sha as a fallback,
which makes the dedupe behavior depend on commit identity instead of the
workflow itself. Update the concurrency group in ci-windows-full.yml to use a
fixed singleton group name for this workflow so any schedule or manual run
shares the same lock and only one full Windows build can run at a time; keep the
existing cancel-in-progress behavior and adjust the group expression near the
concurrency block.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci-windows-full.yml:
- Around line 25-33: The workflow still uses actions/checkout and
actions/setup-node at v3, so update both setup-node steps and the checkout step
in the ci-windows-full workflow to v4. Keep the same behavior for
node-version-file, corepack enable, and pnpm caching, but reference the upgraded
actions so the workflow runs on the current GitHub-hosted runtime.

In @.github/workflows/ci.yml:
- Around line 99-102: Update the Node setup action used in the CI workflows: the
`actions/setup-node` step currently pinned to `@v3` should be upgraded to `@v4`
in the `ci.yml` workflow and the matching step in `ci-windows-full.yml`. Keep
the existing cache settings (`cache` and `cache-dependency-path`) unchanged
while switching the action major version so both workflows stay aligned on the
supported runtime.

---

Nitpick comments:
In @.github/workflows/ci-windows-full.yml:
- Around line 23-25: The build-windows-full job currently relies on the default
broad GITHUB_TOKEN scope and keeps checkout credentials persisted. Add an
explicit permissions block to the workflow or job with the minimum required
access for this build, and update the checkout step to disable credential
persistence. Use the build-windows-full job and its actions/checkout@v3 step as
the place to make these changes.
- Line 29: The Windows workflow is enabling Corepack without pinning the
version, which can make the build non-reproducible across OS planes. Update the
new job’s Corepack setup to match the pinned approach used in the main job, and
apply the same change to the build-windows job in ci.yml; use the existing
corepack enable step as the place to swap in the pinned corepack@0.31.0
invocation.
- Around line 17-19: The concurrency settings for this full Windows workflow are
using github.sha as a fallback, which makes the dedupe behavior depend on commit
identity instead of the workflow itself. Update the concurrency group in
ci-windows-full.yml to use a fixed singleton group name for this workflow so any
schedule or manual run shares the same lock and only one full Windows build can
run at a time; keep the existing cancel-in-progress behavior and adjust the
group expression near the concurrency block.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e9b9e358-bf6b-4a93-9120-845fcccd04d2

📥 Commits

Reviewing files that changed from the base of the PR and between a6a72da and f0ed28f.

📒 Files selected for processing (2)
  • .github/workflows/ci-windows-full.yml
  • .github/workflows/ci.yml

Comment on lines +25 to +33
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
- run: corepack enable
- uses: actions/setup-node@v3
with:
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== workflow excerpt ==\n'
nl -ba .github/workflows/ci-windows-full.yml | sed -n '1,80p'

printf '\n== workflow action versions elsewhere ==\n'
rg -n "actions/(checkout|setup-node)@" .github/workflows || true

printf '\n== node-version file ==\n'
if [ -f .node-version ]; then nl -ba .node-version; fi

Repository: analogjs/analog

Length of output: 217


🌐 Web query:

GitHub Actions checkout v3 setup-node v3 node16 deprecation node20 documentation

💡 Result:

As of June 30, 2026, Node.js 16 has been fully deprecated and removed from GitHub Actions runners [1][2]. The transition from Node 16 to Node 20 was a mandatory infrastructure update initiated by GitHub following the end-of-life status of Node 16 in September 2023 [3][4]. Key details regarding this deprecation include: 1. Actions/Checkout and Setup-Node Versioning: - The actions/checkout v3 and actions/setup-node v3 versions were originally built to run on Node 16. Because they were not natively compatible with the Node 20 runtime environment, they triggered deprecation warnings [5][6][4]. - To resolve these warnings and maintain compatibility, users must upgrade to newer major versions: - Update to actions/checkout@v4 or higher [7][8]. - Update to actions/setup-node@v4 or higher (v5 and v6 are currently available) [5][9][10]. 2. Deprecation Timeline: - Warning phase: Starting October 23, 2023, workflows using Node 16-based actions began displaying deprecation warnings [5][4]. - Default switch: On June 30, 2024, GitHub officially switched the default runner environment to use Node 20 instead of Node 16 [11]. - Full removal: Node 16 reached its final end-of-life in GitHub Actions runners on November 12, 2024, and was removed from standard runner images (such as Ubuntu 20.04/22.04) by November 18, 2024 [1][2]. 3. Impact and Mitigation: - Workflows that still rely on version 3 of these actions may fail if they cannot fallback to a Node 16 environment, as that runtime is no longer supported or available on GitHub-hosted runners [1]. - There is no supported way to continue using Node 16 for these actions in current GitHub-hosted environments; the only valid mitigation is to update the workflow configuration to use the latest major versions of the required actions [1][11].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== workflow excerpt ==\n'
sed -n '1,120p' .github/workflows/ci-windows-full.yml | cat -n

printf '\n== workflow file stats ==\n'
wc -l .github/workflows/ci-windows-full.yml

printf '\n== action references in workflows ==\n'
grep -RIn "actions/\(checkout\|setup-node\)@" .github/workflows || true

printf '\n== node-version file ==\n'
if [ -f .node-version ]; then sed -n '1,20p' .node-version | cat -n; fi

Repository: analogjs/analog

Length of output: 3787


Bump this workflow to actions/checkout@v4 and actions/setup-node@v4.
@v3 still targets the retired Node 16 runtime on GitHub-hosted runners, so both setup-node steps need the upgrade, including the pnpm cache step.

🧰 Tools
🪛 actionlint (1.7.12)

[error] 25-25: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


[error] 26-26: the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)


[error] 30-30: the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🪛 zizmor (1.26.1)

[warning] 25-25: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci-windows-full.yml around lines 25 - 33, The workflow
still uses actions/checkout and actions/setup-node at v3, so update both
setup-node steps and the checkout step in the ci-windows-full workflow to v4.
Keep the same behavior for node-version-file, corepack enable, and pnpm caching,
but reference the upgraded actions so the workflow runs on the current
GitHub-hosted runtime.

Source: Linters/SAST tools

Comment thread .github/workflows/ci.yml
Comment on lines +99 to +102
- uses: actions/setup-node@v3
with:
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '\n== ci.yml ==\n'
sed -n '1,170p' .github/workflows/ci.yml

printf '\n== ci-windows-full.yml ==\n'
sed -n '1,220p' .github/workflows/ci-windows-full.yml

printf '\n== all setup-node usages ==\n'
rg -n "actions/setup-node@" .github/workflows

Repository: analogjs/analog

Length of output: 7133


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '--- ci.yml (around setup-node) ---'
awk 'NR>=85 && NR<=115 {printf "%4d  %s\n", NR, $0}' .github/workflows/ci.yml

echo
echo '--- ci-windows-full.yml (around setup-node) ---'
awk 'NR>=1 && NR<=220 {printf "%4d  %s\n", NR, $0}' .github/workflows/ci-windows-full.yml | rg -n "setup-node|^" -n

echo
echo '--- all setup-node references ---'
rg -n "actions/setup-node@" .github/workflows

Repository: analogjs/analog

Length of output: 4454


🌐 Web query:

actions/setup-node v3 node16 deprecation v4 node20 GitHub Actions official docs

💡 Result:

The transition from actions/setup-node v3 to v4 was primarily driven by the deprecation of Node.js 16 [1]. Because the action itself ran on Node.js 16, users began receiving deprecation warnings in their GitHub Actions workflows as the Node.js 16 runtime reached its end-of-life [1]. In October 2023, GitHub released actions/setup-node v4.0.0, which updated the action's underlying runtime from Node.js 16 to Node.js 20 [2][3]. To address the deprecation notices and ensure continued compatibility, users were advised to update their workflow configurations from actions/setup-node@v3 to actions/setup-node@v4 [1]. It is important to distinguish between two different "Node versions" involved in this action: 1. The Runtime Version: This is the version of Node.js that the GitHub Action itself executes on (e.g., v4 runs on Node.js 20). 2. The Configured Version: This is the version of Node.js that the action installs for your project (configured via the node-version input), which can be any supported Node.js version [4][5]. By upgrading to v4 (or later versions like v5 or v6), you ensure that the action's own execution environment remains supported and secure [2][4]. As of June 2026, actions/setup-node has continued to evolve, with newer versions supporting more recent Node.js runtimes [4].

Citations:


Bump actions/setup-node to @v4 here and in ci-windows-full.yml. @v3 still runs on the deprecated Node 16 runtime; keeping both Windows jobs on the same supported major avoids CI drift.

🧰 Tools
🪛 actionlint (1.7.12)

[error] 99-99: the runner of "actions/setup-node@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 99 - 102, Update the Node setup action
used in the CI workflows: the `actions/setup-node` step currently pinned to
`@v3` should be upgraded to `@v4` in the `ci.yml` workflow and the matching step
in `ci-windows-full.yml`. Keep the existing cache settings (`cache` and
`cache-dependency-path`) unchanged while switching the action major version so
both workflows stay aligned on the supported runtime.

Source: Linters/SAST tools

@brandonroberts
brandonroberts merged commit 3a33734 into beta Jun 30, 2026
20 checks passed
@brandonroberts
brandonroberts deleted the ci/speed-up-build-windows branch June 30, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:ci GitHub workflow changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants