Skip to content

CI recompiles Zebra from scratch for each CI test #9331

@upbqdn

Description

@upbqdn

Each time a PR is updated with a commit, CI recompiles Zebra from sratch for each set of tests, which is ~ 15 times. In some tests, the compilation takes longer than the test itself. CI should cache the compilation results and recompile only what's necessary, not only between image preparation and tests but also between individual preparations. We have the latter implemented: https://github.com/zcashfoundation/zebra/blob/49741e8b476aff1d1dd2f6a2f57ec9d24404d345/docker/Dockerfile#L97-L126, but it doesn't work. CI should also cache downloaded crates instead of pulling them for each compilation.

The solution should cache:

  • Downloaded crates between image preparations.
  • Compiled crates between image preparations.
  • Compiled crates between image preparation and tests.

Ideally, CI should compile Zebra only once per commit for the tests Docker target: https://github.com/zcashfoundation/zebra/blob/882aa038c32e1018959f2617f9258cfdd5e16089/.github/workflows/ci-tests.yml#L130, without recompiling unmodified crates and redownloading all deps.

Metadata

Metadata

Labels

A-devopsArea: Pipelines, CI/CD and DockerfilesI-slowProblems with performance or responsiveness

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions