mirror of
https://github.com/julia-actions/cache.git
synced 2026-02-12 01:16:54 +08:00
add cache-scratchspaces and default enabled (#63)
This commit is contained in:
@@ -15,7 +15,7 @@ jobs:
|
|||||||
test:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
- uses: julia-actions/setup-julia@v1
|
- uses: julia-actions/setup-julia@v1
|
||||||
- uses: julia-actions/cache@v1
|
- uses: julia-actions/cache@v1
|
||||||
- uses: julia-actions/julia-buildpkg@v1
|
- uses: julia-actions/julia-buildpkg@v1
|
||||||
@@ -41,6 +41,7 @@ That is why caching the registries is disabled by default.
|
|||||||
- `cache-packages` - Whether to cache `~/.julia/packages/`. Enabled by default.
|
- `cache-packages` - Whether to cache `~/.julia/packages/`. Enabled by default.
|
||||||
- `cache-registries` - Whether to cache `~/.julia/registries/`. Disabled by default.
|
- `cache-registries` - Whether to cache `~/.julia/registries/`. Disabled by default.
|
||||||
- `cache-compiled` - Whether to cache `~/.julia/compiled/`. Disabled by default. **USE ONLY IF YOU KNOW WHAT YOU'RE DOING!** See [#11](https://github.com/julia-actions/cache/issues/11).
|
- `cache-compiled` - Whether to cache `~/.julia/compiled/`. Disabled by default. **USE ONLY IF YOU KNOW WHAT YOU'RE DOING!** See [#11](https://github.com/julia-actions/cache/issues/11).
|
||||||
|
- `cache-scratchspaces` - Whether to cache `~/.julia/scratchspaces/`. Enabled by default.
|
||||||
|
|
||||||
### Outputs
|
### Outputs
|
||||||
|
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ inputs:
|
|||||||
cache-compiled:
|
cache-compiled:
|
||||||
description: 'Whether to cache ~/.julia/compiled. USE WITH CAUTION! See https://github.com/julia-actions/cache/issues/11 for caveats.'
|
description: 'Whether to cache ~/.julia/compiled. USE WITH CAUTION! See https://github.com/julia-actions/cache/issues/11 for caveats.'
|
||||||
default: 'false'
|
default: 'false'
|
||||||
|
cache-scratchspaces:
|
||||||
|
description: 'Whether to cache ~/.julia/scratchspaces/'
|
||||||
|
default: 'true'
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
cache-hit:
|
cache-hit:
|
||||||
@@ -41,12 +44,14 @@ runs:
|
|||||||
echo "registries-path=$R_PATH" >> $GITHUB_OUTPUT
|
echo "registries-path=$R_PATH" >> $GITHUB_OUTPUT
|
||||||
[ "${{ inputs.cache-compiled }}" = "true" ] && PCC_PATH="~/.julia/compiled"
|
[ "${{ inputs.cache-compiled }}" = "true" ] && PCC_PATH="~/.julia/compiled"
|
||||||
echo "precompilation-cache-path=$PCC_PATH" >> $GITHUB_OUTPUT
|
echo "precompilation-cache-path=$PCC_PATH" >> $GITHUB_OUTPUT
|
||||||
|
[ "${{ inputs.cache-scratchspaces }}" = "true" ] && S_PATH="~/.julia/scratchspaces"
|
||||||
|
echo "scratchspaces-path=$S_PATH" >> $GITHUB_OUTPUT
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
|
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
path: "${{ format('{0}\n{1}\n{2}\n{3}', steps.paths.outputs.artifacts-path, steps.paths.outputs.packages-path, steps.paths.outputs.registries-path, steps.paths.outputs.precompilation-cache-path) }}"
|
path: "${{ format('{0}\n{1}\n{2}\n{3}\n{4}', steps.paths.outputs.artifacts-path, steps.paths.outputs.packages-path, steps.paths.outputs.registries-path, steps.paths.outputs.precompilation-cache-path, steps.paths.outputs.scratchspaces-path) }}"
|
||||||
key: ${{ runner.os }}-${{ inputs.cache-name }}-${{ hashFiles('**/Project.toml') }}
|
key: ${{ runner.os }}-${{ inputs.cache-name }}-${{ hashFiles('**/Project.toml') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-${{ inputs.cache-name }}-
|
${{ runner.os }}-${{ inputs.cache-name }}-
|
||||||
|
|||||||
Reference in New Issue
Block a user