Anvil
Building blocksEnvironmentsProvisioningCache

Overview

Choose a cache for downloaded software or reusable workspace files and configure its location.

Use caches to reuse inputs and generated files between runs. Choose the guide for the data you want to retain:

GuideUse it for
ArtifactsDownloaded server and proxy software, Java installations, and resolution metadata; includes offline and refresh settings
SnapshotsSelected files or directories produced in a process workspace, such as server libraries

Configure the cache location

Both use the shared cache root, normally ~/.anvil. Choose another location through anvil { engine { cacheDirectory } } in Gradle or EngineOptions.cacheDirectory when embedding. See Directories for the Gradle setup. Keep the same root when preparing an environment and later running it offline.

Share selected data

For another machine or CI run, copy only the cache data you intend to reuse. The root can also contain private authentication accounts; exclude those account files rather than archiving the entire root. See Authentication.

On GitHub Actions, Anvil Actions does this for you: whereareiam/anvil-actions/setup@v1 keeps downloaded software, Java installations and workspace snapshots in the Actions cache and leaves accounts out, and whereareiam/anvil-actions/report@v1 uploads the console logs of failed scenarios.

On this page