Skip to content

perf(ci): optimize workflow with caching and concurrency#8

Merged
crodriguesbr merged 2 commits into
mainfrom
perf/optimize-ci-workflow
Dec 5, 2025
Merged

perf(ci): optimize workflow with caching and concurrency#8
crodriguesbr merged 2 commits into
mainfrom
perf/optimize-ci-workflow

Conversation

@crodriguesbr
Copy link
Copy Markdown
Contributor

@crodriguesbr crodriguesbr commented Dec 5, 2025

Description

This PR optimizes the CI and Release workflows to improve build times, reduce unnecessary resource usage, and enhance security.

Changes

  • NuGet Package Caching: Added actions/cache@v4 to cache NuGet packages between workflow runs, reducing dependency restore time
  • Concurrency Control: Added concurrency settings to automatically cancel in-progress runs when a new commit is pushed to the same branch
  • Environment Variables: Added DOTNET_NOLOGO to suppress .NET welcome messages and reduce output noise
  • Security Hardening: Added explicit permissions blocks to limit GITHUB_TOKEN to minimal required access following the principle of least privilege

Benefits

  • Faster CI builds due to cached dependencies
  • Reduced GitHub Actions minutes by canceling redundant runs
  • Cleaner workflow logs
  • Improved security posture with restricted token permissions

Testing

  • CI workflow runs successfully
  • Caching works as expected on subsequent runs
  • Release workflow still creates releases correctly

- Add NuGet package caching to speed up dependency restore
- Add concurrency control to cancel redundant workflow runs
- Add DOTNET_NOLOGO environment variable to reduce output noise
Limit GITHUB_TOKEN to read-only contents access following the principle
of least privilege for improved workflow security.
@crodriguesbr crodriguesbr merged commit db69921 into main Dec 5, 2025
6 checks passed
@crodriguesbr crodriguesbr deleted the perf/optimize-ci-workflow branch December 5, 2025 22:57
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