Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(ci): cache all of submodules/deps to speed up build time #1731

Merged
merged 1 commit into from
May 16, 2023

Conversation

vpavlin
Copy link
Member

@vpavlin vpavlin commented May 15, 2023

Description

I've been experimenting with how we use cache inour CI builds - we only cache the nim compiler binary, which leads to potentially unnecessary rebuilds of some libs and recursive submodule initialization on every build.

I believe I was able to get vendor/ submodules caching properly, so that we can reuse all of the content without submodule init and rebuilds of deps.

I've experimented with this in a fork of nwaku repo (https://github.com/nwaku-test-org/nwaku/blob/master/.github/workflows/test-cache.yml) and the change seemed to result in change of build time from 21-25 mins down to 13-17 mins.

Potential drawback is that previously when one submodule changed we'd still use cached nim compiler, but here it will trigger a compiler rebuild on the PR which is updating a dependency - hence longer builds on PR changing the deps, but those seem to be relatively rare, so hopefully the benefits outweight that.

Changes

  • all GH actions jobs now use cached vendor/
  • removed explicit caching of zerokit artifacts as they fall under the vendor/

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it looks great! Thanks for it :)

Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! See my nitpick below. :)


- name: Get submodule versions
- name: Get Submodules Hash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pure nitpick from my side, but can we get these names to follow the same capitalisation (i.e. only first letter capitalised)?

Suggested change
- name: Get Submodules Hash
- name: Get submodules hash

Here and elsewhere.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pardon my morning ignorance. Fixed

@vpavlin vpavlin force-pushed the feat/speed-up-ci branch 2 times, most recently from b6c5b26 to 175fb17 Compare May 15, 2023 15:00
@vpavlin vpavlin merged commit 4394c69 into master May 16, 2023
13 checks passed
@vpavlin vpavlin deleted the feat/speed-up-ci branch May 16, 2023 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants