How to Profile a GitHub Actions Workflow
Profiling a workflow means mapping where every minute goes, then attacking the critical path.
A workflow profile is a timeline: which jobs ran in parallel, which serialized via needs:, and which step inside each dominated.
Build the job timeline
Pull all job start/end times and draw the parallel-vs-serial structure. The longest dependent chain is your critical path.
Profile inside the gating job
For the critical-path job, read step durations from the logs or API. One step usually dominates.
Check cache hit rate
Grep run logs for "Cache restored"/"Cache not found". A consistent miss is wasted minutes hiding in plain sight.
Spot serialization to parallelize
Independent jobs chained by needs: that do not truly depend on each other can run in parallel; that collapses the critical path.
Key takeaways
- Map parallel vs serial structure first.
- Profile the gating job step by step.
- Check cache hit rate and unnecessary serialization.