add cache-scratchspaces and default enabled (#63)

This commit is contained in:
Ian Butterworth
2023-11-02 07:12:59 -04:00
committed by GitHub
parent 5867e4d730
commit 8ef8d3313f
2 changed files with 8 additions and 2 deletions

View File

@@ -22,6 +22,9 @@ inputs:
cache-compiled:
description: 'Whether to cache ~/.julia/compiled. USE WITH CAUTION! See https://github.com/julia-actions/cache/issues/11 for caveats.'
default: 'false'
cache-scratchspaces:
description: 'Whether to cache ~/.julia/scratchspaces/'
default: 'true'
outputs:
cache-hit:
@@ -41,12 +44,14 @@ runs:
echo "registries-path=$R_PATH" >> $GITHUB_OUTPUT
[ "${{ inputs.cache-compiled }}" = "true" ] && PCC_PATH="~/.julia/compiled"
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
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
id: cache
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') }}
restore-keys: |
${{ runner.os }}-${{ inputs.cache-name }}-