Skip to content

fix: avoid downloading package when local cache exists - #123

Merged
sylvestre merged 2 commits into
Mozilla-Actions:mainfrom
i10416:fix/add-local-cache-search-before-download
Jul 18, 2024
Merged

fix: avoid downloading package when local cache exists#123
sylvestre merged 2 commits into
Mozilla-Actions:mainfrom
i10416:fix/add-local-cache-search-before-download

Conversation

@i10416

@i10416 i10416 commented Jun 18, 2024

Copy link
Copy Markdown
Contributor

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

@Xuanwo Xuanwo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

Comment thread src/setup.ts
// 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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i10416 added 2 commits July 18, 2024 10:27
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.
@sylvestre
sylvestre merged commit 3405202 into Mozilla-Actions:main Jul 18, 2024
renovate Bot referenced this pull request in vortex-data/vortex Sep 27, 2024
…942)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[mozilla-actions/sccache-action](https://redirect.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://redirect.github.com/Mozilla-Actions/sccache-action/releases/tag/v0.0.6)

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

##### What's Changed

- fix: string interpolation by
[@&#8203;i10416](https://redirect.github.com/i10416) in
[https://github.com/Mozilla-Actions/sccache-action/pull/122](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/122)
- Keep GitHub Actions up to date with GitHub's Dependabot by
[@&#8203;cclauss](https://redirect.github.com/cclauss) in
[https://github.com/Mozilla-Actions/sccache-action/pull/131](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/131)
- fix: avoid downloading package when local cache exists by
[@&#8203;i10416](https://redirect.github.com/i10416) in
[https://github.com/Mozilla-Actions/sccache-action/pull/123](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/123)
- Set baseUrl for Octokit to make it work on GitHub Enterprise Server by
[@&#8203;palloberg](https://redirect.github.com/palloberg) in
[https://github.com/Mozilla-Actions/sccache-action/pull/144](https://redirect.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://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/130](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/130)
- Bump ts-jest from 29.1.4 to 29.2.2 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/134](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/134)
- Bump [@&#8203;types/node](https://redirect.github.com/types/node) from
20.13.0 to 20.14.11 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/133](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/133)
- Bump
[@&#8203;typescript-eslint/eslint-plugin](https://redirect.github.com/typescript-eslint/eslint-plugin)
from 7.8.0 to 7.16.1 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/132](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/132)
- Bump typescript from 5.4.5 to 5.5.3 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/128](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/128)
- Bump ts-jest from 29.2.2 to 29.2.5 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/141](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/141)
- Bump eslint-plugin-prettier from 5.1.3 to 5.2.1 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/140](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/140)
- Bump prettier from 3.3.2 to 3.3.3 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/136](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/136)
- Bump typescript from 5.5.3 to 5.6.2 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/145](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/145)

##### New Contributors

- [@&#8203;i10416](https://redirect.github.com/i10416) made their first
contribution in
[https://github.com/Mozilla-Actions/sccache-action/pull/122](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/122)
- [@&#8203;cclauss](https://redirect.github.com/cclauss) made their
first contribution in
[https://github.com/Mozilla-Actions/sccache-action/pull/131](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/131)
- [@&#8203;palloberg](https://redirect.github.com/palloberg) made their
first contribution in
[https://github.com/Mozilla-Actions/sccache-action/pull/144](https://redirect.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://redirect.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://redirect.github.com/Mozilla-Actions/sccache-action/releases/tag/v0.0.6)

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

##### What's Changed

- fix: string interpolation by
[@&#8203;i10416](https://redirect.github.com/i10416) in
[https://github.com/Mozilla-Actions/sccache-action/pull/122](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/122)
- Keep GitHub Actions up to date with GitHub's Dependabot by
[@&#8203;cclauss](https://redirect.github.com/cclauss) in
[https://github.com/Mozilla-Actions/sccache-action/pull/131](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/131)
- fix: avoid downloading package when local cache exists by
[@&#8203;i10416](https://redirect.github.com/i10416) in
[https://github.com/Mozilla-Actions/sccache-action/pull/123](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/123)
- Set baseUrl for Octokit to make it work on GitHub Enterprise Server by
[@&#8203;palloberg](https://redirect.github.com/palloberg) in
[https://github.com/Mozilla-Actions/sccache-action/pull/144](https://redirect.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://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/130](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/130)
- Bump ts-jest from 29.1.4 to 29.2.2 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/134](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/134)
- Bump [@&#8203;types/node](https://redirect.github.com/types/node) from
20.13.0 to 20.14.11 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/133](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/133)
- Bump
[@&#8203;typescript-eslint/eslint-plugin](https://redirect.github.com/typescript-eslint/eslint-plugin)
from 7.8.0 to 7.16.1 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/132](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/132)
- Bump typescript from 5.4.5 to 5.5.3 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/128](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/128)
- Bump ts-jest from 29.2.2 to 29.2.5 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/141](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/141)
- Bump eslint-plugin-prettier from 5.1.3 to 5.2.1 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/140](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/140)
- Bump prettier from 3.3.2 to 3.3.3 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/136](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/136)
- Bump typescript from 5.5.3 to 5.6.2 by
[@&#8203;dependabot](https://redirect.github.com/dependabot) in
[https://github.com/Mozilla-Actions/sccache-action/pull/145](https://redirect.github.com/Mozilla-Actions/sccache-action/pull/145)

##### New Contributors

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