From 8ef8d3313f5536c64072e04a9dad48c6669dc264 Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Thu, 2 Nov 2023 07:12:59 -0400 Subject: [PATCH] add `cache-scratchspaces` and default enabled (#63) --- README.md | 3 ++- action.yml | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d5ac9b0..ff0778d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@v1 - uses: julia-actions/cache@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-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-scratchspaces` - Whether to cache `~/.julia/scratchspaces/`. Enabled by default. ### Outputs diff --git a/action.yml b/action.yml index 65ad5e6..b966dad 100644 --- a/action.yml +++ b/action.yml @@ -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 }}-