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
renovate bot referenced this pull request in spiraldb/vortex Sep 27, 2024
…942)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[mozilla-actions/sccache-action](https://github.com/mozilla-actions/sccache-action)
| action | patch | `v0.0.5` -> `v0.0.6` |

---

### Release Notes

<details>
<summary>mozilla-actions/sccache-action
(mozilla-actions/sccache-action)</summary>

###
[`v0.0.6`](https://github.com/Mozilla-Actions/sccache-action/releases/tag/v0.0.6)

[Compare
Source](https://github.com/mozilla-actions/sccache-action/compare/v0.0.5...v0.0.6)

##### What's Changed

- fix: string interpolation by
[@&#8203;i10416](https://github.com/i10416) in
[https://github.com/Mozilla-Actions/sccache-action/pull/122](https://github.com/Mozilla-Actions/sccache-action/pull/122)
- Keep GitHub Actions up to date with GitHub's Dependabot by
[@&#8203;cclauss](https://github.com/cclauss) in
[https://github.com/Mozilla-Actions/sccache-action/pull/131](https://github.com/Mozilla-Actions/sccache-action/pull/131)
- fix: avoid downloading package when local cache exists by
[@&#8203;i10416](https://github.com/i10416) in
[https://github.com/Mozilla-Actions/sccache-action/pull/123](https://github.com/Mozilla-Actions/sccache-action/pull/123)
- Set baseUrl for Octokit to make it work on GitHub Enterprise Server by
[@&#8203;palloberg](https://github.com/palloberg) in
[https://github.com/Mozilla-Actions/sccache-action/pull/144](https://github.com/Mozilla-Actions/sccache-action/pull/144)

##### dependencies

- Bump eslint-plugin-jest from 28.5.0 to 28.6.0 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/130](https://github.com/Mozilla-Actions/sccache-action/pull/130)
- Bump ts-jest from 29.1.4 to 29.2.2 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/134](https://github.com/Mozilla-Actions/sccache-action/pull/134)
- Bump [@&#8203;types/node](https://github.com/types/node) from
20.13.0 to 20.14.11 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/133](https://github.com/Mozilla-Actions/sccache-action/pull/133)
- Bump
[@&#8203;typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin)
from 7.8.0 to 7.16.1 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/132](https://github.com/Mozilla-Actions/sccache-action/pull/132)
- Bump typescript from 5.4.5 to 5.5.3 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/128](https://github.com/Mozilla-Actions/sccache-action/pull/128)
- Bump ts-jest from 29.2.2 to 29.2.5 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/141](https://github.com/Mozilla-Actions/sccache-action/pull/141)
- Bump eslint-plugin-prettier from 5.1.3 to 5.2.1 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/140](https://github.com/Mozilla-Actions/sccache-action/pull/140)
- Bump prettier from 3.3.2 to 3.3.3 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/136](https://github.com/Mozilla-Actions/sccache-action/pull/136)
- Bump typescript from 5.5.3 to 5.6.2 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/145](https://github.com/Mozilla-Actions/sccache-action/pull/145)

##### New Contributors

- [@&#8203;i10416](https://github.com/i10416) made their first
contribution in
[https://github.com/Mozilla-Actions/sccache-action/pull/122](https://github.com/Mozilla-Actions/sccache-action/pull/122)
- [@&#8203;cclauss](https://github.com/cclauss) made their
first contribution in
[https://github.com/Mozilla-Actions/sccache-action/pull/131](https://github.com/Mozilla-Actions/sccache-action/pull/131)
- [@&#8203;palloberg](https://github.com/palloberg) made their
first contribution in
[https://github.com/Mozilla-Actions/sccache-action/pull/144](https://github.com/Mozilla-Actions/sccache-action/pull/144)

**Full Changelog**:
Mozilla-Actions/sccache-action@v0.0.5...v0.0.6

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/spiraldb/vortex).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC45Ny4wIiwidXBkYXRlZEluVmVyIjoiMzguOTcuMCIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AiLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
renovate bot referenced this pull request in spiraldb/fastlanes Sep 27, 2024
)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[mozilla-actions/sccache-action](https://github.com/mozilla-actions/sccache-action)
| action | patch | `v0.0.5` -> `v0.0.6` |

---

### Release Notes

<details>
<summary>mozilla-actions/sccache-action
(mozilla-actions/sccache-action)</summary>

###
[`v0.0.6`](https://github.com/Mozilla-Actions/sccache-action/releases/tag/v0.0.6)

[Compare
Source](https://github.com/mozilla-actions/sccache-action/compare/v0.0.5...v0.0.6)

##### What's Changed

- fix: string interpolation by
[@&#8203;i10416](https://github.com/i10416) in
[https://github.com/Mozilla-Actions/sccache-action/pull/122](https://github.com/Mozilla-Actions/sccache-action/pull/122)
- Keep GitHub Actions up to date with GitHub's Dependabot by
[@&#8203;cclauss](https://github.com/cclauss) in
[https://github.com/Mozilla-Actions/sccache-action/pull/131](https://github.com/Mozilla-Actions/sccache-action/pull/131)
- fix: avoid downloading package when local cache exists by
[@&#8203;i10416](https://github.com/i10416) in
[https://github.com/Mozilla-Actions/sccache-action/pull/123](https://github.com/Mozilla-Actions/sccache-action/pull/123)
- Set baseUrl for Octokit to make it work on GitHub Enterprise Server by
[@&#8203;palloberg](https://github.com/palloberg) in
[https://github.com/Mozilla-Actions/sccache-action/pull/144](https://github.com/Mozilla-Actions/sccache-action/pull/144)

##### dependencies

- Bump eslint-plugin-jest from 28.5.0 to 28.6.0 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/130](https://github.com/Mozilla-Actions/sccache-action/pull/130)
- Bump ts-jest from 29.1.4 to 29.2.2 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/134](https://github.com/Mozilla-Actions/sccache-action/pull/134)
- Bump [@&#8203;types/node](https://github.com/types/node) from
20.13.0 to 20.14.11 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/133](https://github.com/Mozilla-Actions/sccache-action/pull/133)
- Bump
[@&#8203;typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/eslint-plugin)
from 7.8.0 to 7.16.1 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/132](https://github.com/Mozilla-Actions/sccache-action/pull/132)
- Bump typescript from 5.4.5 to 5.5.3 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/128](https://github.com/Mozilla-Actions/sccache-action/pull/128)
- Bump ts-jest from 29.2.2 to 29.2.5 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/141](https://github.com/Mozilla-Actions/sccache-action/pull/141)
- Bump eslint-plugin-prettier from 5.1.3 to 5.2.1 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/140](https://github.com/Mozilla-Actions/sccache-action/pull/140)
- Bump prettier from 3.3.2 to 3.3.3 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/136](https://github.com/Mozilla-Actions/sccache-action/pull/136)
- Bump typescript from 5.5.3 to 5.6.2 by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/145](https://github.com/Mozilla-Actions/sccache-action/pull/145)

##### New Contributors

- [@&#8203;i10416](https://github.com/i10416) made their first
contribution in
[https://github.com/Mozilla-Actions/sccache-action/pull/122](https://github.com/Mozilla-Actions/sccache-action/pull/122)
- [@&#8203;cclauss](https://github.com/cclauss) made their
first contribution in
[https://github.com/Mozilla-Actions/sccache-action/pull/131](https://github.com/Mozilla-Actions/sccache-action/pull/131)
- [@&#8203;palloberg](https://github.com/palloberg) made their
first contribution in
[https://github.com/Mozilla-Actions/sccache-action/pull/144](https://github.com/Mozilla-Actions/sccache-action/pull/144)

**Full Changelog**:
Mozilla-Actions/sccache-action@v0.0.5...v0.0.6

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/spiraldb/fastlanes).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC45Ny4wIiwidXBkYXRlZEluVmVyIjoiMzguOTcuMCIsInRhcmdldEJyYW5jaCI6ImRldmVsb3AiLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
jschwe added a commit to jschwe/servo that referenced this pull request Sep 27, 2024
Interesting changes since v0.0.4

- fix: avoid downloading package when local cache exists in Mozilla-Actions/sccache-action#123
- Output sccache stats as a notice and a summary table in Mozilla-Actions/sccache-action#113

v0.0.6 changelog: https://github.com/Mozilla-Actions/sccache-action/releases/tag/v0.0.6

v0.0.5 changelog: https://github.com/Mozilla-Actions/sccache-action/releases/tag/v0.0.5

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
github-merge-queue bot pushed a commit to servo/servo that referenced this pull request Sep 27, 2024
Interesting changes since v0.0.4

- fix: avoid downloading package when local cache exists in Mozilla-Actions/sccache-action#123
- Output sccache stats as a notice and a summary table in Mozilla-Actions/sccache-action#113

v0.0.6 changelog: https://github.com/Mozilla-Actions/sccache-action/releases/tag/v0.0.6

v0.0.5 changelog: https://github.com/Mozilla-Actions/sccache-action/releases/tag/v0.0.5

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
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