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

aqua-installer's caching #394

Merged
merged 1 commit into from
May 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions docs/products/aqua-installer.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,51 @@ policy_allow | `""` | aqua >= `v2.3.0`. If this is `"true"`, `aqua policy allow`
Please see [action.yaml](https://github.com/aquaproj/aqua-installer/blob/main/action.yaml) too.

Nothing.

### :bulb: Caching

[#428](https://github.com/aquaproj/aqua-installer/issues/428)

aqua-installer doesn't support caching, but you can cache packages and registries using `actions/cache`.

e.g.

```yaml
- uses: actions/cache@v3.3.1
with:
path: ~/.local/share/aquaproj-aqua
key: v1-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('aqua.yaml')}}
restore-keys: |
v1-aqua-installer-${{runner.os}}-${{runner.arch}}-
- uses: aquaproj/aqua-installer@v2.1.1
with:
aqua_version: v2.6.0
```

Please fix `actions/cache`'s parameters properly.
If you [split `aqua.yaml` using import](/docs/guides/split-config) or use local Registries, you may have to add hashes of them to key and restore-keys.

e.g.

```yaml
- uses: actions/cache@v3.3.1
with:
path: ~/.local/share/aquaproj-aqua
key: v1-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('.aqua/*.yaml')}} # Change key
restore-keys: |
v1-aqua-installer-${{runner.os}}-${{runner.arch}}-
```

aqua-installer runs aqua with [-l](https://aquaproj.github.io/docs/tutorial/install-only-link) option by default, so packages that aren't run in the workflow aren't cached.
If you want to cache all packages, please set `aqua_opts` to unset `-l` option.

```yaml
- uses: aquaproj/aqua-installer@v2.1.1
with:
aqua_version: v2.6.0
aqua_opts: "" # Unset `-l` option
```

But if `-l` is unset, aqua installs packages that aren't run in the workflow uselessly.

So it is up to you that whether and how you cache packages.