Skip to content

Speed up copy-artifacts.yaml (currently ~11 min) #499

@thedavidmeister

Description

@thedavidmeister

The copy-artifacts.yaml workflow takes ~11 minutes per run, which is the longest step on this repo's CI. Each push runs it. With the broader CI matrix queued behind it on shared Ubuntu runners, this is the dominant feedback-loop cost.

Breakdown

Each run performs:

  1. Checkout
  2. Nix install + cache restore
  3. soldeer install
  4. Meta regeneration via the rain CLI (the rainlang-meta task in flake.nix)
  5. Pointer regeneration script
  6. Solidity compile (src/ + script/ + test/)
  7. ABI-copy script (jq-extract deterministic subset of 11 contracts)
  8. Format check
  9. git diff --exit-code

Each nix develop / nix run invocation pays some Nix evaluation overhead even when the store is warm.

Likely wins

  • Combine steps into a single nix develop session. Multiple separate nix develop invocations each re-evaluate the flake. Wrapping the 5 sol-shell steps in one session saves N-1 evaluations.
  • Skip the standalone build when the ABI-copy script can derive what it needs from the prior step. Pointer regeneration + ABI copy together touch all 11 target contracts; if those scripts trigger compilation of their imports, a separate build step is redundant.
  • Cache foundry artifacts across runs (~/.foundry/cache, cache/, out/) — currently cold every run.
  • Conditional execution — if the pushed commit doesn't touch any *.sol, *.toml, *.nix, meta/, or crates/abi/, skip the whole job.

Notes

  • rain.math.float's copy-artifacts.yaml is structurally similar but smaller (2 contracts vs 11) and has no meta-build step. The same fixes apply there.
  • Once Ship a rainix-copy-artifacts.yaml reusable workflow rainix#169 ships a shared rainix-copy-artifacts.yaml reusable, these wins should land in the reusable rather than per-repo.

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions