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

fix: avoid downloading package when local cache exists #123

Conversation

i10416
Copy link
Contributor

@i10416 i10416 commented Jun 18, 2024

As mentioned in
#107, setup function didn't use find function even though it uses cacheDir to store downloaded files, which leads to redundant download.

It is not significant on GitHub-hosted runners because cacheDir stores files in local file system, which is ephemeral. However, it wastes time on self-hosted runners.

This commit adds a step to search local file system cache for sccache as well as splitting download procedure to a dedicated function.

@i10416 i10416 mentioned this pull request Jun 18, 2024
Copy link
Collaborator

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Thanks!

// Search local file system cache for sccache.
// This is useful when actions run on a self-hosted runner.
let sccacheHome = find('sccache', version);
if (sccacheHome === '') {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@sylvestre sylvestre force-pushed the fix/add-local-cache-search-before-download branch from bbaa6a8 to de2ec3d Compare June 18, 2024 07:56
@sylvestre sylvestre force-pushed the fix/add-local-cache-search-before-download branch from de2ec3d to 5201bf8 Compare July 18, 2024 07:31
As mentioned in
Mozilla-Actions#107,
`setup` function didn't use `find` function even though it uses
`cacheDir` to store downloaded files, which leads to redundant download.

It is not significant on GitHub-hosted runners because
`cacheDir` stores files in local file system, which is ephemeral.
However, it wastes time on self-hosted runners.

This commit adds a step to search local file system cache for sccache as
well as splitting download procedure to a dedicated function.
@sylvestre sylvestre force-pushed the fix/add-local-cache-search-before-download branch from 5201bf8 to 8dbd02f Compare July 18, 2024 08:27
@sylvestre sylvestre merged commit 3405202 into Mozilla-Actions:main Jul 18, 2024
7 checks passed
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.

3 participants