Skip to content

ci: Optimize GitHub Actions workflow performance#3477

Merged
tippmar-nr merged 14 commits into
mainfrom
ci/workflow-optimizations
Mar 12, 2026
Merged

ci: Optimize GitHub Actions workflow performance#3477
tippmar-nr merged 14 commits into
mainfrom
ci/workflow-optimizations

Conversation

@tippmar-nr

@tippmar-nr tippmar-nr commented Mar 11, 2026

Copy link
Copy Markdown
Member

Summary

Reduces CI overhead across 12 workflow files through four strategies:

  • Blobless partial clones — Many jobs used fetch-depth: 0 (full clone of all commits, tags, and file blobs). Most only need commit history for version tagging via git describe. Adding filter: blob:none tells git to fetch commits and tags but download file blobs only on demand at checkout, reducing initial clone size while preserving versioning. All 13 bare fetch-depth: 0 occurrences now use blobless clones.
  • NuGet package caching — Added actions/cache to 7 build jobs, saving ~1-2 minutes per job by avoiding redundant package downloads. This was the biggest measurable improvement.
  • Scoped artifact uploadssiteextension_release was uploading the entire workspace; now uploads only the build output. Updated deploy_siteextension download path to match.
  • Sparse checkout — 6 validation jobs in post_deploy_agent now check out only the directory they need.

Test plan

  • Verify all_solutions workflow passes (build + integration tests + unbounded tests)
  • Verify versioning works correctly with blobless clones (Versioning.targets git describe)
  • Verify post_deploy_agent sparse checkouts work (next release cycle)
  • Trigger siteextension_release manually to verify scoped artifact upload/download

🤖 Generated with Claude Code

tippmar-nr and others added 10 commits March 11, 2026 11:06
…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-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.66%. Comparing base (1799395) to head (53cfb9c).

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     
Flag Coverage Δ
Agent 82.65% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

tippmar-nr and others added 4 commits March 11, 2026 16:29
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>
@tippmar-nr tippmar-nr marked this pull request as ready for review March 12, 2026 17:00
@tippmar-nr tippmar-nr requested a review from a team as a code owner March 12, 2026 17:00

@nr-ahemsath nr-ahemsath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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. 👍

@tippmar-nr tippmar-nr merged commit 263a326 into main Mar 12, 2026
144 of 147 checks passed
@tippmar-nr tippmar-nr deleted the ci/workflow-optimizations branch March 12, 2026 18:56
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.

4 participants