Module

GitHub.Actions.Cache

Exports functions from the @actions/cache module provided by GitHub https://github.com/actions/toolkit/tree/main/packages/cache

#DownloadOptions

type DownloadOptions = { downloadConcurrency :: Maybe Boolean, timeoutInMs :: Maybe Number, useAzureSdk :: Maybe Boolean }

useAzureSdk: Indicates whether to use the Azure Blob SDK to download caches that are stored on Azure Blob Storage to improve reliability and performance useAzureSdk default: true downloadConcurrency: Number of parallel downloads (this option only applies when using the Azure SDK) downloadConcurrency default: 8 Maximum time for each download request, in milliseconds (this option only applies when using the Azure SDK) timeoutInMs default: 30000

#defaultDownloadOptions

defaultDownloadOptions :: DownloadOptions

A default set of Download Options. Override as needed

#RestoreCacheArgs

type RestoreCacheArgs = { options :: Maybe DownloadOptions, paths :: Array String, primaryKey :: String, restoreKeys :: Maybe (Array String) }

paths: a list of file paths to restore from the cache primaryKey: an explicit key for restoring the cache restoreKeys: an optional ordered list of keys to use for restoring the cache if no cache hit occurred for key downloadOptions: cache download options

#SaveCacheArgs

type SaveCacheArgs = { key :: String, options :: Maybe UploadOptions, paths :: Array String }

paths: a list of file paths to be cached key: an explicit key for restoring the cache options: cache upload options

#UploadOptions

type UploadOptions = { uploadChunkSize :: Maybe Number, uploadConcurrency :: Maybe Number }

uploadConcurrency: Number of parallel cache upload uploadConcurrency default: 4 uploadChunkSize: Maximum chunk size in bytes for cache upload uploadChunkSize default: 32MB

#defaultUploadOptions

defaultUploadOptions :: UploadOptions

A default set of Upload Options. Override as needed

#restoreCache

restoreCache :: RestoreCacheArgs -> ExceptT Error Aff (Maybe String)

Restores a cache based on primaryKey and restoreKeys to the paths provided. Function returns the cache key for cache hit. See https://github.com/actions/toolkit/tree/main/packages/cache#save-cache

#restoreCache'

restoreCache' :: { paths :: Array String, primaryKey :: String } -> ExceptT Error Aff (Maybe String)

Restores a cache based on primaryKey to the paths provided. Function returns the cache key for cache hit. https://github.com/actions/toolkit/tree/main/packages/cache#restore-cache

#saveCache

saveCache :: SaveCacheArgs -> ExceptT Error Aff Number

Saves a cache containing the files in paths using the key provided. The files would be compressed using zstandard compression algorithm if zstd is installed, otherwise gzip is used. Function returns the cache id if the cache was saved succesfully and throws an error if cache upload fails. See https://github.com/actions/toolkit/tree/main/packages/cache#save-cache

#saveCache'

saveCache' :: { key :: String, paths :: Array String } -> ExceptT Error Aff Number

Saves a cache containing the files in paths using the key provided. The files would be compressed using zstandard compression algorithm if zstd is installed, otherwise gzip is used. Function returns the cache id if the cache was saved succesfully and throws an error if cache upload fails. See https://github.com/actions/toolkit/tree/main/packages/cache#save-cache

Modules