mirror of
https://github.com/julia-actions/cache.git
synced 2026-02-14 01:56:54 +08:00
Compare commits
5 Commits
v1
...
ib/always_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64e2b31172 | ||
|
|
5898e5c965 | ||
|
|
1470e42d30 | ||
|
|
216aaef29a | ||
|
|
3e0649aaee |
@@ -29,6 +29,13 @@ jobs:
|
|||||||
|
|
||||||
By default all depot directories called out below are cached.
|
By default all depot directories called out below are cached.
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
|
||||||
|
This action uses [`jq`](https://github.com/jqlang/jq) to parse JSON.
|
||||||
|
`jq` is installed by default in GitHub-hosted runners.
|
||||||
|
[`dcarbone/install-jq-action`](https://github.com/dcarbone/install-jq-action) is used to check that `jq` is available and install it if not.
|
||||||
|
**Note:** installing `jq` with `dcarbone/install-jq-action` requires that curl is available; this may not be the case in custom containers.
|
||||||
|
|
||||||
### Optional Inputs
|
### Optional Inputs
|
||||||
|
|
||||||
- `cache-name` - The cache key prefix. Defaults to `julia-cache;workflow=${{ github.workflow }};job=${{ github.job }}`. The key body automatically includes the OS and, unless disabled with `include-matrix`, the matrix vars. Include any other parameters/details in this prefix to ensure one unique cache key per concurrent job type.
|
- `cache-name` - The cache key prefix. Defaults to `julia-cache;workflow=${{ github.workflow }};job=${{ github.job }}`. The key body automatically includes the OS and, unless disabled with `include-matrix`, the matrix vars. Include any other parameters/details in this prefix to ensure one unique cache key per concurrent job type.
|
||||||
@@ -40,6 +47,7 @@ By default all depot directories called out below are cached.
|
|||||||
- `cache-compiled` - Whether to cache the depot's `compiled` directory. Defaults to `true`.
|
- `cache-compiled` - Whether to cache the depot's `compiled` directory. Defaults to `true`.
|
||||||
- `cache-scratchspaces` - Whether to cache the depot's `scratchspaces` directory. Defaults to `true`.
|
- `cache-scratchspaces` - Whether to cache the depot's `scratchspaces` directory. Defaults to `true`.
|
||||||
- `cache-logs` - Whether to cache the depot's `logs` directory. Defaults to `true`. Helps auto-`Pkg.gc()` keep the cache small.
|
- `cache-logs` - Whether to cache the depot's `logs` directory. Defaults to `true`. Helps auto-`Pkg.gc()` keep the cache small.
|
||||||
|
- `save-always` - Whether to save the cache even when the job fails. Defaults to `true`. This is useful as the Julia depot should mostly be reusable from a failing job.
|
||||||
- `delete-old-caches` - Whether to delete old caches for the given key. Defaults to `true`.
|
- `delete-old-caches` - Whether to delete old caches for the given key. Defaults to `true`.
|
||||||
- `token` - A [GitHub PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens). Defaults to `github.token`. Requires `repo` scope to enable the deletion of old caches.
|
- `token` - A [GitHub PAT](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens). Defaults to `github.token`. Requires `repo` scope to enable the deletion of old caches.
|
||||||
|
|
||||||
|
|||||||
11
action.yml
11
action.yml
@@ -36,6 +36,9 @@ inputs:
|
|||||||
cache-logs:
|
cache-logs:
|
||||||
description: Whether to cache the depot's `logs` directory. This helps automatic `Pkg.gc()` keep the cache size down.
|
description: Whether to cache the depot's `logs` directory. This helps automatic `Pkg.gc()` keep the cache size down.
|
||||||
default: 'true'
|
default: 'true'
|
||||||
|
save-always:
|
||||||
|
description: Whether to save the cache even when the job fails. This is useful as the Julia depot should mostly be reusable from a failing job.
|
||||||
|
default: 'true'
|
||||||
delete-old-caches:
|
delete-old-caches:
|
||||||
description: Whether to delete old caches for the given key.
|
description: Whether to delete old caches for the given key.
|
||||||
default: 'true'
|
default: 'true'
|
||||||
@@ -52,10 +55,7 @@ runs:
|
|||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- name: Install jq
|
- name: Install jq
|
||||||
# Skip installation on GitHub-hosted runners:
|
uses: dcarbone/install-jq-action@8867ddb4788346d7c22b72ea2e2ffe4d514c7bcb # v2.1.0
|
||||||
# https://github.com/orgs/community/discussions/48359#discussioncomment-5323864
|
|
||||||
if: ${{ !startsWith(runner.name, 'GitHub Actions') }}
|
|
||||||
uses: dcarbone/install-jq-action@v2.1.0
|
|
||||||
with:
|
with:
|
||||||
force: false # Skip install when an existing `jq` is present
|
force: false # Skip install when an existing `jq` is present
|
||||||
|
|
||||||
@@ -118,7 +118,7 @@ runs:
|
|||||||
env:
|
env:
|
||||||
MATRIX_JSON: ${{ toJSON(matrix) }}
|
MATRIX_JSON: ${{ toJSON(matrix) }}
|
||||||
|
|
||||||
- uses: actions/cache@4d4ae6ae148a43d0fd1eda1800170683e9882738
|
- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
@@ -126,6 +126,7 @@ runs:
|
|||||||
key: ${{ steps.keys.outputs.key }}
|
key: ${{ steps.keys.outputs.key }}
|
||||||
restore-keys: ${{ steps.keys.outputs.restore-key }}
|
restore-keys: ${{ steps.keys.outputs.restore-key }}
|
||||||
enableCrossOsArchive: false
|
enableCrossOsArchive: false
|
||||||
|
save-always: ${{ inputs.save-always }}
|
||||||
|
|
||||||
# if it wasn't restored make the depot anyway as a signal that this action ran
|
# if it wasn't restored make the depot anyway as a signal that this action ran
|
||||||
# for other julia actions to check, like https://github.com/julia-actions/julia-buildpkg/pull/41
|
# for other julia actions to check, like https://github.com/julia-actions/julia-buildpkg/pull/41
|
||||||
|
|||||||
Reference in New Issue
Block a user