Skip to content

Add NuGet caching and format-check job to CI#3388

Draft
mbroshi-stripe wants to merge 1 commit into
masterfrom
mbroshi/nuget-cache-and-format-check
Draft

Add NuGet caching and format-check job to CI#3388
mbroshi-stripe wants to merge 1 commit into
masterfrom
mbroshi/nuget-cache-and-format-check

Conversation

@mbroshi-stripe
Copy link
Copy Markdown
Contributor

Why?

dotnet format and dotnet build/restore re-download NuGet packages on every CI run because there's no package cache configured. This adds actions/cache@v5 to every job that runs dotnet commands, so warm runs skip the network fetch entirely.

There's also no format check in CI today — developers have to remember to run just prepare locally. This adds an explicit format-check job that enforces it on every PR.

What?

  • Added actions/cache@v5 for ~/.nuget/packages to all six jobs that run dotnet commands: test, test-net462, build, pack, build-examples, compat. Cache key is keyed on all .csproj files, with an OS prefix so the Linux and Windows jobs maintain separate caches.
  • Added a new format-check job (PR-only) that:
    • Uses fetch-depth: 0 so it can diff against the base branch
    • Exits early with success if no .cs files changed
    • When .cs files did change, runs both format commands from just format scoped to only those files via --include, matching the repo's existing format recipe exactly

See Also

N/A

Changelog

  • Added NuGet package caching (actions/cache@v5) to all CI jobs that build or restore dotnet packages.
  • Added format-check CI job that verifies dotnet format on changed .cs files for every pull request.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Committed-By-Agent: claude
@mbroshi-stripe mbroshi-stripe requested a review from a team as a code owner May 27, 2026 13:08
@mbroshi-stripe mbroshi-stripe requested review from prathmesh-stripe and removed request for a team May 27, 2026 13:08
@mbroshi-stripe mbroshi-stripe marked this pull request as draft May 27, 2026 13:10
@mbroshi-stripe mbroshi-stripe removed the request for review from prathmesh-stripe May 27, 2026 13:10
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.

1 participant