Skip to content

Combine sbt CI steps to reduce JVM startup overhead #4507

Closed

Description

@Yicong-Huang

Task Summary

.github/workflows/github-action-build.yml runs four separate sbt invocations in the scala job:

sbt scalafmtCheckAll       # Lint with scalafmt
sbt clean package          # Compile with sbt
sbt "scalafixAll --check"  # Lint with scalafix
sbt test                   # Run backend tests

Each sbt invocation pays the same cold-start cost: launcher boot, project loading, plugin resolution (~19,160 settings), and dependency tree resolve. Local measurement on a warm worktree shows this overhead is ~5–6s per invocation; on the CI runner it is ~12–15s. Across the four invocations, that's ~36–60s of pure repeated startup with no useful work.

Combining the four into a single invocation — sbt 'scalafmtCheckAll; scalafixAll --check; test' — pays the startup cost once. clean package becomes redundant: test already triggers compile and Test/compile via the standard sbt task graph, and a fresh CI runner has no stale target/ to clean.

The non-sbt steps (Create Databases, Set docker-java API version) just need to run before test; they can be moved before the combined sbt step.

Priority

P2 – Medium

Task Type

  • DevOps / Deployment

Activity

  1. added 2 commits that reference this issue on Apr 26, 2026
    691dc08
    04cf85a
  2. self-assigned this
    on Apr 26, 2026
  3. added a commit that references this issue on Jun 22, 2026
    448d620
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions