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

Cache dependencies on github actions (#1296) #1337

Merged
merged 16 commits into from
Jun 21, 2024

Conversation

dinhlongviolin1
Copy link
Member

@dinhlongviolin1 dinhlongviolin1 commented May 30, 2024

Resolve #1296

Caching for both npm and pipenv (for tests only). Deployment/build will still do everything from scratch.
Caching was also added for frontend build.

For npm, the dependency was declared and those will be used to hash as the cache name.

For pipenv, the recommended file is Pipfile.lock. But since we don't use Pipfile.lock (mainly due to multiple os support), Pipfile will be used. We might have to manually delete the cache from here if any dev packages get a major/breaking update. Pipenv caching will work both for the min Pipfile and max Pipfile as those will be produce 2 different caches due to the different file hashes.

The cache will be removed automatically after 7 days if not used in any action. There is no limit on the number of cache, but there is a hard limit of 10 GB of cache per repo.

@dinhlongviolin1 dinhlongviolin1 self-assigned this May 30, 2024
@dinhlongviolin1 dinhlongviolin1 changed the title Cache dependencies on github actions Cache dependencies on github actions (#1296) May 30, 2024
@dinhlongviolin1 dinhlongviolin1 added 🖧 Devops Operations, monitoring, maintenance, deployment, packaging 📈 Improvement Improvement of a feature. labels May 30, 2024
FredLL-Avaiga
FredLL-Avaiga previously approved these changes May 30, 2024
Copy link
Member

@FredLL-Avaiga FredLL-Avaiga left a comment

Choose a reason for hiding this comment

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

I'm learning everyday 👍

Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

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

So that was impressive! 🤯

Copy link
Contributor

github-actions bot commented May 30, 2024

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
18626 16256 87% 0% 🟢

New Files

No new covered files...

Modified Files

No covered modified files...

updated for commit: c33f391 by action🐍

Copy link
Member

@jrobinAV jrobinAV left a comment

Choose a reason for hiding this comment

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

This PR only covers partial tests. Why not the overall tests as well?

.github/workflows/partial-tests.yml Show resolved Hide resolved
.github/workflows/partial-tests.yml Outdated Show resolved Hide resolved
.github/workflows/partial-tests.yml Outdated Show resolved Hide resolved
.github/workflows/partial-tests.yml Show resolved Hide resolved
@FabienLelaquais FabienLelaquais self-requested a review May 30, 2024 16:10
Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

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

🤯🤯🤯

@dinhlongviolin1
Copy link
Member Author

This PR only covers partial tests. Why not the overall tests as well?

The overall tests uses the install/action.yml file for installation of the dependencies. The cache is already implemented in that file.

@dinhlongviolin1
Copy link
Member Author

dinhlongviolin1 commented May 30, 2024

This PR only covers partial tests. Why not the overall tests as well?

We can also remove the python setup within overall-tests.yml file since it will be setup in the install/action.yml file. @florian-vuillemot can you confirm this

jrobinAV
jrobinAV previously approved these changes May 30, 2024
@FabienLelaquais FabienLelaquais self-requested a review May 30, 2024 20:14
Copy link
Member

@FabienLelaquais FabienLelaquais left a comment

Choose a reason for hiding this comment

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

👍👍

@dinhlongviolin1
Copy link
Member Author

Caching the frontend build is also added!

FredLL-Avaiga
FredLL-Avaiga previously approved these changes May 31, 2024
tools/frontend/hash_source.py Show resolved Hide resolved
jrobinAV
jrobinAV previously approved these changes Jun 11, 2024
tools/frontend/hash_source.py Outdated Show resolved Hide resolved
@joaoandre-avaiga
Copy link
Collaborator

LGTM! Great job @dinhlongviolin1

@jrobinAV
Copy link
Member

@dinhlongviolin1 Let's merge it if that's fine for everyone so we can finally benefit from it.

@dinhlongviolin1 dinhlongviolin1 merged commit fbadcf3 into develop Jun 21, 2024
157 checks passed
@dinhlongviolin1 dinhlongviolin1 deleted the feature/#1296-cache-dependencies branch June 21, 2024 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🖧 Devops Operations, monitoring, maintenance, deployment, packaging 📈 Improvement Improvement of a feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance github action speed by caching dependencies
6 participants