-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Caching directories outside of workspace (self-hosted vs GitHub-hosted) #1127
Description
We are using actions/cache in between jobs that run on a variety of runners (GitHub-hosted and self-hosted) and we noticed the following:
When creating a cache on ubuntu-latest of a directory that is outside the workspace (for example Java - Maven caches the ~/.m2/repository directory), we noticed that the cache archive stores paths relative to the current workspace directory (using ../../..).
When restoring this path on a self-hosted runner, this means that the cache restore will place the files on the ../../.. directory relative to the working directory of the self-hosted runner. This may be different from the filesystem structure of the GitHub-hosted runners, meaning that the cache will be restored in the wrong location (and maven will not be able to find it)
##[debug]Archive Path: /runner/_work/_temp/3670ed6f-f2b5-4387-b1c0-7dee396807af/cache.tzst
##[debug]Use Azure SDK: true
##[debug]Download concurrency: 8
##[debug]Request timeout (ms): 30000
##[debug]Cache segment download timeout mins env var: 5
##[debug]Segment download timeout (ms): 300000
##[debug]Downloading segment at offset 0 with length 262618027...
Received 0 of 262618027 (0.0%), 0.0 MBs/sec
Received 46137344 of 262618027 (17.6%), 22.0 MBs/sec
Received 92274688 of 262618027 (35.1%), 29.3 MBs/sec
Received 146800640 of 262618027 (55.9%), 35.0 MBs/sec
Received 197132288 of 262618027 (75.1%), 37.6 MBs/sec
Received 254229419 of 262618027 (96.8%), 40.4 MBs/sec
Received 262618027 of 262618027 (100.0%), 39.8 MBs/sec
/usr/bin/tar -tf /runner/_work/_temp/3670ed6f-f2b5-4387-b1c0-7dee396807af/cache.tzst -P --use-compress-program unzstd
../../../.m2/repository/
../../../.m2/repository/log4j/
../../../.m2/repository/log4j/log4j/