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

Use SCons and Gradle cache on CI to improve build times #189

Merged
merged 1 commit into from
Jul 17, 2024

Conversation

dsnopek
Copy link
Collaborator

@dsnopek dsnopek commented Jul 11, 2024

This should improve build times on all PRs, but it will have the biggest impact on PRs that only change docs or CI configuration or anything not directly code related, because it'll re-use all the build artifacts from the cache.

Here's a build with an empty cache:

Selection_181

And here's one with no changes to the code with the cache fully populated:

Selection_182

I'm not entirely sure why the Android builds still take ~6 minutes, but it's a big improvement from ~15 minutes in any case! I think it may be because Gradle is running cmake and we aren't getting any of the cmake stuff cached?

NOTE: Marking this as a draft because it includes PR #170, which is currently necessary for the CI to pass. I'll take out of draft and rebase once that one is merged.

@dsnopek dsnopek added the enhancement New feature or request label Jul 11, 2024
@dsnopek dsnopek added this to the 3.0.0 milestone Jul 11, 2024
Copy link
Collaborator

@devloglogan devloglogan left a comment

Choose a reason for hiding this comment

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

Looks good at a glance!

@dsnopek dsnopek changed the title [DRAFT] Use SCons cache on CI to improve build times [DRAFT] Use SCons and Gradle cache on CI to improve build times Jul 12, 2024
@dsnopek
Copy link
Collaborator Author

dsnopek commented Jul 12, 2024

I've integrated a Gradle cache into this PR too, hoping that it would improve the Android build times, however, it only did so marginally:

Selection_186

So, only like ~30s faster. :-) I think we aren't getting the gains we should because Gradle is running cmake, and we aren't getting any of the cmake stuff cached? That's something that can probably be improved later, either by adding some cmake caching, or maybe telling Gradle about its intermediate artifacts so it can do the caching? Anyway, I think that can be saved for later.

I also noticed that we have two identical Android builds, that only capture different sets of artifacts. So, I've reduced that to one build that captures both sets of artifacts. The GodotOpenXRVendorsAddon.zip that is created still has all the same files and is the same size.

Copy link
Collaborator

@m4gr3d m4gr3d left a comment

Choose a reason for hiding this comment

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

Looks good!

@@ -3,6 +3,11 @@ name: Build on push

on: [push, pull_request]

env:
# Only used for the cache key. Increment version to force clean build.
GODOT_BASE_BRANCH: master
Copy link
Collaborator

Choose a reason for hiding this comment

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

Which version is the comment referring to?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's the version of the plugin really, but since I'm reusing the action from godot-cpp (which copied it from Godot), it has that name.

Anyway, if we use this on another branch (other than master) we'll want to change that to the name of the branch

@dsnopek dsnopek changed the title [DRAFT] Use SCons and Gradle cache on CI to improve build times Use SCons and Gradle cache on CI to improve build times Jul 17, 2024
@dsnopek
Copy link
Collaborator Author

dsnopek commented Jul 17, 2024

Rebased after PR #170 has been merged, and so taking out of draft.

@m4gr3d m4gr3d merged commit 99afb1a into GodotVR:master Jul 17, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants