Skip to content

[Repo Assist] ci: add NuGet package caching to test job #66

Closed

Description

@github-actions

🤖 This is an automated PR from Repo Assist.

Summary

The test CI job restores NuGet packages from nuget.org on every run with no caching. Adding an actions/cache@v4 step lets subsequent runs reuse the cached packages directory, typically saving 30–60 seconds on windows-latest.

Change

One new step inserted in the test job, between Setup .NET 10 and Install GitVersion:

- name: Cache NuGet packages
  uses: actions/cache@v4
  with:
    path: ~/.nuget/packages
    key: nuget-$\{\{ runner.os }}-$\{\{ hashFiles('**/*.csproj') }}
    restore-keys: nuget-$\{\{ runner.os }}-

Cache key strategy:

  • Primary key: OS + hash of all .csproj files → exact match when dependencies haven't changed
  • Restore key fallback: nuget-(OS)- → warm partial hit when csproj files change, while a new full cache is built in parallel

The build and build-msix jobs (which run after test) each do dotnet restore themselves but restore only a single project. They benefit less from caching because they already run only on tag pushes and PRs. Adding caching there can be done in a follow-up if desired.

Why not setup-dotnet's built-in cache: true?

setup-dotnet's cache: option requires packages.lock.json lock files to be committed to the repo. This repo doesn't currently use lock files, so using that option would cause CI failures.

Test Status

This is a CI workflow change only — no source code changes. No build/test run required; the workflow is valid YAML and uses only well-established GitHub Actions (actions/cache@v4).

Generated by Repo Assist · ◷

To install this agentic workflow, run

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

Warning

🛡️ Protected Files — Push Permission Denied

This was originally intended as a pull request, but the patch modifies protected files: .github/workflows/ci.yml.

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. A human must create the pull request manually.

To create a pull request with the changes:

# Download the patch from the workflow run
gh run download 23245365706 -n agent-artifacts -D /tmp/agent-artifacts-23245365706

# Create a new branch
git checkout -b repo-assist/eng-ci-nuget-cache-2026-03-18-e0414f939be62604 master

# Apply the patch (--3way handles cross-repo patches)
git am --3way /tmp/agent-artifacts-23245365706/aw-repo-assist-eng-ci-nuget-cache-2026-03-18.patch

# Push the branch and create the pull request
git push origin repo-assist/eng-ci-nuget-cache-2026-03-18-e0414f939be62604
gh pr create --title '[Repo Assist] ci: add NuGet package caching to test job' --base master --head repo-assist/eng-ci-nuget-cache-2026-03-18-e0414f939be62604 --repo openclaw/openclaw-windows-node

Activity

  1. shanselman commented on Mar 18, 2026

    @shanselman
    Collaborator

    Superseded by #67, which manually applies the same NuGet cache step. Original couldn't be pushed due to workflow file permissions.

  2. locked as resolved and limited conversation to collaborators on May 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions