mirror of
https://github.com/julia-actions/cache.git
synced 2026-02-12 17:36:53 +08:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ef8d3313f | ||
|
|
5867e4d730 | ||
|
|
2d9095b561 | ||
|
|
4616a55a79 | ||
|
|
ec00ba5d20 | ||
|
|
75868c023d | ||
|
|
d006556bca | ||
|
|
adbfa18f98 | ||
|
|
ed93024b72 | ||
|
|
3ea06f8ffc |
4
.github/workflows/CI.yml
vendored
4
.github/workflows/CI.yml
vendored
@@ -33,7 +33,7 @@ jobs:
|
||||
fail-fast: false
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
|
||||
- name: Save cache
|
||||
id: cache
|
||||
uses: ./
|
||||
@@ -56,7 +56,7 @@ jobs:
|
||||
fail-fast: false
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c
|
||||
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
|
||||
- name: Restore cache
|
||||
id: cache
|
||||
uses: ./
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
21
action.yml
21
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:
|
||||
@@ -34,22 +37,24 @@ runs:
|
||||
- id: paths
|
||||
run: |
|
||||
[ "${{ inputs.cache-artifacts }}" = "true" ] && A_PATH="~/.julia/artifacts"
|
||||
echo "ARTIFACTS_PATH=$A_PATH" >> $GITHUB_ENV
|
||||
echo "artifacts-path=$A_PATH" >> $GITHUB_OUTPUT
|
||||
[ "${{ inputs.cache-packages }}" = "true" ] && P_PATH="~/.julia/packages"
|
||||
echo "PACKAGES_PATH=$P_PATH" >> $GITHUB_ENV
|
||||
echo "packages-path=$P_PATH" >> $GITHUB_OUTPUT
|
||||
[ "${{ inputs.cache-registries }}" = "true" ] && R_PATH="~/.julia/registries"
|
||||
echo "REGISTRIES_PATH=$R_PATH" >> $GITHUB_ENV
|
||||
echo "registries-path=$R_PATH" >> $GITHUB_OUTPUT
|
||||
[ "${{ inputs.cache-compiled }}" = "true" ] && PCC_PATH="~/.julia/compiled"
|
||||
echo "PRECOMPILATION_CACHE_PATH=$PCC_PATH" >> $GITHUB_ENV
|
||||
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@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
|
||||
- uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84
|
||||
id: cache
|
||||
with:
|
||||
path: "${{ format('{0}\n{1}\n{2}\n{3}', env.ARTIFACTS_PATH, env.PACKAGES_PATH, env.REGISTRIES_PATH, env.PRECOMPILATION_CACHE_PATH) }}"
|
||||
key: ${{ runner.os }}-test-${{ inputs.cache-name }}-${{ hashFiles('**/Project.toml') }}
|
||||
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 }}-test-${{ inputs.cache-name }}-
|
||||
${{ runner.os }}-${{ inputs.cache-name }}-
|
||||
|
||||
- id: hit
|
||||
run: echo "cache-hit=$CACHE_HIT" >> $GITHUB_OUTPUT
|
||||
|
||||
Reference in New Issue
Block a user