Skip to content

[Repo Assist] [Eng] Add NuGet and npm package caching to CI workflow #4522

@github-actions

Description

@github-actions

🤖 This pull request was created by Repo Assist, an automated AI assistant.

Summary

Adds NuGet package caching and npm download-cache caching to every job in the CI workflow, reducing redundant package downloads on every run.

Closes #4486

Changes

  • actions/setup-dotnet: adds cache: true and cache-dependency-path: "**/*.fsproj" to all 11 Setup .NET steps. The action caches ~/.nuget/packages and uses a cache key derived from the hash of all .fsproj files, so the cache automatically invalidates when NuGet dependencies change.

  • actions/setup-node: adds cache: npm to all 5 Setup Node.js environment steps. The action caches the npm download cache (~/.npm) keyed on the root package-lock.json hash.

Expected Benefit

NuGet restore downloads can take 1-3 minutes per job. With ~11 jobs running per PR (some in parallel, some on matrix), caching saves significant CI time on repeat runs where dependencies have not changed — which is the common case.

Notes

  • The cache: true option in setup-dotnet@v5 is the officially recommended approach and handles both Linux and Windows paths automatically.
  • The cache: npm option in setup-node@v5 does not skip npm install — it only caches the download cache. The actual install still runs, but is faster when packages are already cached.
  • No behaviour changes to the tests or build scripts.

Warning

Protected Files — Push Permission Denied

This was originally intended as a pull request, but the patch modifies protected files. A human must create the pull request manually.

Protected files

The push was rejected because GitHub Actions does not have workflows permission to push these changes, and is never allowed to make such changes, or other authorization being used does not have this permission.

Create the pull request manually
# Download the patch from the workflow run
gh run download 24221005907 -n agent -D /tmp/agent-24221005907

# Create a new branch
git checkout -b repo-assist/eng-ci-nuget-npm-caching-2026-04-de479ba7cc732133 main

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-24221005907/aw-repo-assist-eng-ci-nuget-npm-caching-2026-04.patch

# Push the branch and create the pull request
git push origin repo-assist/eng-ci-nuget-npm-caching-2026-04-de479ba7cc732133
gh pr create --title '[Repo Assist] [Eng] Add NuGet and npm package caching to CI workflow' --base main --head repo-assist/eng-ci-nuget-npm-caching-2026-04-de479ba7cc732133 --repo fable-compiler/Fable

Generated by Repo Assist · ● 10.4M ·

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@346204513ecfa08b81566450d7d599556807389f

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions