Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: speed up test coverage job in CI #1115

Merged
merged 6 commits into from
Feb 17, 2025
Merged

perf: speed up test coverage job in CI #1115

merged 6 commits into from
Feb 17, 2025

Conversation

bowenli86
Copy link
Member

@bowenli86 bowenli86 commented Feb 15, 2025

Motivation:

After multiple improvements to other parts of our CI, the coverage job has become the longest-running task, limiting the total CI runtime.

This PR significantly reduces the coverage runtime from 16-18 minutes (already down from 26 minutes thanks to a previous improvement using an x64 16-core runner) to just 2 minutes—an 8-9x speedup.

Modifications:

  • Parallelized coverage report generation.
  • Cached Foundry and Cargo artifacts.
  • Optimized Forge arguments.

Result:

The coverage runtime is reduced from 16-18 minutes (previously 26 minutes) to 2 minutes, achieving an 8-9x improvement.

@bowenli86
Copy link
Member Author

image

@bowenli86 bowenli86 marked this pull request as ready for review February 15, 2025 06:23
@bowenli86 bowenli86 changed the title perf: speed up test coverage perf: speed up test coverage job in CI Feb 15, 2025
@0xClandestine
Copy link
Member

Surprised this worked, pre parallelism caching led to longer ci times.

Copy link
Member

@0xClandestine 0xClandestine left a comment

Choose a reason for hiding this comment

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

One suggestion, looks good otherwise.

.github/workflows/foundry.yml Outdated Show resolved Hide resolved
@bowenli86
Copy link
Member Author

the most expensive part now of coverage is now installing loc

foundry.toml Show resolved Hide resolved
@0xClandestine 0xClandestine self-requested a review February 17, 2025 20:07
@ypatil12
Copy link
Collaborator

🔥🔥🔥

@0xClandestine 0xClandestine merged commit 742402b into dev Feb 17, 2025
9 checks passed
@0xClandestine 0xClandestine deleted the feat/coverage branch February 17, 2025 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants