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

Add caching to the github workflows #189

Open
wants to merge 67 commits into
base: main
Choose a base branch
from

Conversation

neilenns
Copy link
Contributor

@neilenns neilenns commented Oct 27, 2024

Fixes #185

Our github workflows take around 30 minutes to build right now. This is because of four slow parts:

  • Installing vcpkg
  • Building afv-native
  • Installing node modules
  • Downloading electron-builder dependencies

There's also an additional unnecessary npm install step that, while short, does add some time that could be saved and was removed.

This PR adds caching for all of those items:

  • vcpkg: Cached in release and CI builds using the vcpkg.json and vcpkg submodule SHA as the hash key
  • afv-native: Cached in CI builds using all the files under backend/, the afv-native submodule SHA, and the libuiohook submodule SHA, as the hash key
  • node modules: Cached in CI and release builds using the built-in caching mechanism of actions/setup-node
  • electron-builder dependencies: Cached in release and CI builds using package-lock.json as the hash key

This cuts the build time down from 30 minutes to around 2 minutes for mac and linux and 3 minutes for windows (which is always slower for some reason).

.github/workflows/ci.yml Show resolved Hide resolved
.github/workflows/release.yml Outdated Show resolved Hide resolved
@neilenns neilenns requested a review from pierr3 November 3, 2024 20:13
.github/actions/restore-cache/action.yml Outdated Show resolved Hide resolved
.github/actions/restore-cache/action.yml Outdated Show resolved Hide resolved
@neilenns neilenns requested a review from pierr3 November 5, 2024 16:15
@neilenns
Copy link
Contributor Author

This now handles the new libuiohook native dependency.

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.

Cache dependencies to speed up build time
2 participants