setup-java download jdk binary again every time due to not cache tool folder #70
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
And github runner can cache container
toolcache
folderhttps://github.com/actions/setup-java/issues/470#issuecomment-1480814653
The runner mounts the
act-toolcache
volume to/toolcache
directory (See342ad6a51a/pkg/runner/run_context.go (L108)
)In my test, the files created by a task will remain in the volume even after the task has finished. If I rerun the task, the file will still be there. The workflow is like:
I also test the
setup-java
action. But it is strange that thesetup-java
action doesn't seem to write data to the/toolcache
directory. I'll test other actions to check if they cache files there.At present, the
act-toolcache
volume is mounted to/toolcache
and the data in/toolcache
will be stored persistently. But the problem is that actions don't write data to/toolcache
but to/opt/hostedtoolcache
(specified by theRUNNER_TOOL_CACHE
env, seecfedc518ca/pkg/runner/run_context.go (L236)
)Maybe we need to support users to configure the volumes that will be mounted to
RUNNER_TOOL_CACHE
. Now there is a workaround: set theRUNNER_TOOL_CACHE
env manually in the workflow, like this:My test:
First run (no cache):

Second run (get from cache):

act-toolcache
volume: