bevy-website icon indicating copy to clipboard operation
bevy-website copied to clipboard

Parallel actions in CI and add a cache

Open IceSentry opened this issue 3 years ago • 0 comments

Objective

CI takes a long time because each generate job is done sequentially and there's no caching. Fix that.

Solution

Create one job per generate-* and wait until they are done to build the website.

  • Each job uploads artifacts
  • The final jobs download all the artifacts and use them to build the website
  • Each job also caches their respective build artifacts to speed up build time
    • For the wasm-examples it also caches the wasm files. The cache is invalidated once the bevy version tagged latest changes

This is all done only for the CI workflow. Eventually this could also be done with the deploy workflow by using something like https://docs.github.com/en/actions/using-workflows/reusing-workflows.

This is what the jobs look like now. The timing were done with a pre-existing cache.

vivaldi_TOqEly8nzH

Notes

The longest job by far is still generating examples right now, but generating the assets metadata is about to get a lot longer. I believe we can create multiple jobs to parallelize the examples a bit more. Probably one per category. This can be done in a future PR.

I changed how the assets path are generated because it was causing issues when trying to zip them before the upload,

IceSentry avatar Jul 24 '22 00:07 IceSentry