ci: Optimize GitHub Actions workflow performance#3477
Merged
Conversation
…gration test jobs which now use the beta image with VS2026
Remove unnecessary fetch-depth: 0 (24 occurrences across 8 workflows), add NuGet package caching, scope overly broad artifact uploads, and use sparse checkout where only specific directories are needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Keep NuGet cache blocks added in previous commit; main had removed a blank line after checkout steps causing trivial conflicts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Versioning.targets uses git describe --tags during MSBuild, so jobs that run dotnet build/test or MSBuild need full git history for version resolution. Restores fetch-depth: 0 for 6 build jobs while keeping shallow clones for the 18 non-build jobs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3477 +/- ##
==========================================
- Coverage 81.68% 81.66% -0.02%
==========================================
Files 508 508
Lines 33972 33972
Branches 4006 4006
==========================================
- Hits 27750 27744 -6
- Misses 5264 5268 +4
- Partials 958 960 +2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
Replace fetch-depth: 0 with filter: blob:none for 6 build jobs that need git commit history (for Versioning.targets git describe/rev-list) but don't need full blob downloads. Blobless clones fetch all commits and tags while deferring blob downloads to on-demand, reducing clone time while preserving versioning functionality. Affected jobs: build-integration-tests, build-unbounded-tests (all_solutions), Windows build (build_profiler), analyze-dotnet, analyze-cpp (codeql), run-unit-tests (unit_tests). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Same optimization as other build jobs — filter: blob:none provides commit history for Versioning.targets without full blob download. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The filter input alone doesn't override actions/checkout's default shallow clone (depth=1, no tags). Both fetch-depth: 0 and filter: blob:none are needed together to get a full commit history with on-demand blob downloads. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The run-artifactbuilder job calls generateBuildProperties.ps1 which uses git describe for versioning. It needs fetch-depth: 0 with filter: blob:none like the other build jobs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
nr-ahemsath
approved these changes
Mar 12, 2026
nr-ahemsath
left a comment
Member
There was a problem hiding this comment.
I ran the post-deploy workflow in test mode from this branch and it passed: https://github.com/newrelic/newrelic-dotnet-agent/actions/runs/23014952701
Approved. 👍
nrcventura
approved these changes
Mar 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reduces CI overhead across 12 workflow files through four strategies:
fetch-depth: 0(full clone of all commits, tags, and file blobs). Most only need commit history for version tagging viagit describe. Addingfilter: blob:nonetells git to fetch commits and tags but download file blobs only on demand at checkout, reducing initial clone size while preserving versioning. All 13 barefetch-depth: 0occurrences now use blobless clones.actions/cacheto 7 build jobs, saving ~1-2 minutes per job by avoiding redundant package downloads. This was the biggest measurable improvement.siteextension_releasewas uploading the entire workspace; now uploads only the build output. Updateddeploy_siteextensiondownload path to match.post_deploy_agentnow check out only the directory they need.Test plan
all_solutionsworkflow passes (build + integration tests + unbounded tests)Versioning.targetsgit describe)post_deploy_agentsparse checkouts work (next release cycle)siteextension_releasemanually to verify scoped artifact upload/download🤖 Generated with Claude Code