mirror of
				https://kkgithub.com/actions/cache.git
				synced 2025-11-04 12:41:50 +08:00 
			
		
		
		
	Compare commits
	
		
			38 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| f5b55ae568 | |||
| 2387ae8f10 | |||
| 875b52c705 | |||
| 97ba7aa16d | |||
| 81375c4b58 | |||
| 9716b96acd | |||
| eeff95f289 | |||
| 8584e116c7 | |||
| 0c44ddbd87 | |||
| 8de84b9d78 | |||
| 128caf4219 | |||
| 2d8d0d1c9b | |||
| 7799d864d9 | |||
| 4b0cf6cc46 | |||
| 60c606a2b4 | |||
| b6e9a919a7 | |||
| c842503583 | |||
| 2b7da2a62c | |||
| deae296ab3 | |||
| c7c46bcb6d | |||
| 6535c5fb5f | |||
| 3fdafa472e | |||
| 341e6d75d9 | |||
| 3fe001f5ca | |||
| ab4bea262c | |||
| 7772fcab79 | |||
| 6c2ab9416b | |||
| 2c7b30f330 | |||
| 73cb7e0405 | |||
| 757c5a8ca4 | |||
| 4e817c1f42 | |||
| 72d1e4fdff | |||
| de7c17c6a9 | |||
| 447f0fd1d3 | |||
| 47e8bd685f | |||
| 795a8f09a9 | |||
| 4762de4681 | |||
| 12ed05f49a | 
							
								
								
									
										2
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							@ -34,7 +34,7 @@ jobs:
 | 
			
		||||
      run: |
 | 
			
		||||
        echo "::set-output name=dir::$(npm config get cache)"
 | 
			
		||||
    - name: Restore npm cache
 | 
			
		||||
      uses: actions/cache@v2
 | 
			
		||||
      uses: actions/cache@v3
 | 
			
		||||
      with:
 | 
			
		||||
        path: ${{ steps.npm-cache.outputs.dir }}
 | 
			
		||||
        key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,9 +1,9 @@
 | 
			
		||||
---
 | 
			
		||||
name: "@actions/cache"
 | 
			
		||||
version: 1.0.9
 | 
			
		||||
version: 1.0.10
 | 
			
		||||
type: npm
 | 
			
		||||
summary: Actions cache lib
 | 
			
		||||
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
 | 
			
		||||
summary: 
 | 
			
		||||
homepage: 
 | 
			
		||||
license: mit
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE.md
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								.licenses/npm/@actions/exec.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.licenses/npm/@actions/exec.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,9 +1,9 @@
 | 
			
		||||
---
 | 
			
		||||
name: "@actions/exec"
 | 
			
		||||
version: 1.1.0
 | 
			
		||||
version: 1.1.1
 | 
			
		||||
type: npm
 | 
			
		||||
summary: Actions exec lib
 | 
			
		||||
homepage: https://github.com/actions/toolkit/tree/main/packages/exec
 | 
			
		||||
summary: 
 | 
			
		||||
homepage: 
 | 
			
		||||
license: mit
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE.md
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								.licenses/npm/@actions/io.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.licenses/npm/@actions/io.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,9 +1,9 @@
 | 
			
		||||
---
 | 
			
		||||
name: "@actions/io"
 | 
			
		||||
version: 1.1.1
 | 
			
		||||
version: 1.1.2
 | 
			
		||||
type: npm
 | 
			
		||||
summary: Actions io lib
 | 
			
		||||
homepage: https://github.com/actions/toolkit/tree/main/packages/io
 | 
			
		||||
summary: 
 | 
			
		||||
homepage: 
 | 
			
		||||
license: mit
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE.md
 | 
			
		||||
 | 
			
		||||
@ -1,9 +1,9 @@
 | 
			
		||||
---
 | 
			
		||||
name: "@azure/core-asynciterator-polyfill"
 | 
			
		||||
version: 1.0.0
 | 
			
		||||
version: 1.0.2
 | 
			
		||||
type: npm
 | 
			
		||||
summary: Polyfill for IE/Node 8 for Symbol.asyncIterator
 | 
			
		||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-asynciterator-polyfill
 | 
			
		||||
summary: 
 | 
			
		||||
homepage: 
 | 
			
		||||
license: mit
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										7
									
								
								.licenses/npm/@azure/core-lro.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										7
									
								
								.licenses/npm/@azure/core-lro.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,10 +1,9 @@
 | 
			
		||||
---
 | 
			
		||||
name: "@azure/core-lro"
 | 
			
		||||
version: 2.2.3
 | 
			
		||||
version: 2.2.4
 | 
			
		||||
type: npm
 | 
			
		||||
summary: Isomorphic client library for supporting long-running operations in node.js
 | 
			
		||||
  and browser.
 | 
			
		||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/README.md
 | 
			
		||||
summary: 
 | 
			
		||||
homepage: 
 | 
			
		||||
license: mit
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										7
									
								
								.licenses/npm/@azure/ms-rest-js.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										7
									
								
								.licenses/npm/@azure/ms-rest-js.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,10 +1,9 @@
 | 
			
		||||
---
 | 
			
		||||
name: "@azure/ms-rest-js"
 | 
			
		||||
version: 2.6.0
 | 
			
		||||
version: 2.6.1
 | 
			
		||||
type: npm
 | 
			
		||||
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
 | 
			
		||||
  libraries generated using AutoRest
 | 
			
		||||
homepage: https://github.com/Azure/ms-rest-js
 | 
			
		||||
summary: 
 | 
			
		||||
homepage: 
 | 
			
		||||
license: mit
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								.licenses/npm/@azure/storage-blob.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.licenses/npm/@azure/storage-blob.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,9 +1,9 @@
 | 
			
		||||
---
 | 
			
		||||
name: "@azure/storage-blob"
 | 
			
		||||
version: 12.8.0
 | 
			
		||||
version: 12.9.0
 | 
			
		||||
type: npm
 | 
			
		||||
summary: Microsoft Azure Storage SDK for JavaScript - Blob
 | 
			
		||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
 | 
			
		||||
summary: 
 | 
			
		||||
homepage: 
 | 
			
		||||
license: mit
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								.licenses/npm/@opentelemetry/api.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.licenses/npm/@opentelemetry/api.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,9 +1,9 @@
 | 
			
		||||
---
 | 
			
		||||
name: "@opentelemetry/api"
 | 
			
		||||
version: 1.0.4
 | 
			
		||||
version: 1.1.0
 | 
			
		||||
type: npm
 | 
			
		||||
summary: Public API for OpenTelemetry
 | 
			
		||||
homepage: https://github.com/open-telemetry/opentelemetry-js-api#readme
 | 
			
		||||
summary: 
 | 
			
		||||
homepage: 
 | 
			
		||||
license: apache-2.0
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								.licenses/npm/@types/node-fetch.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.licenses/npm/@types/node-fetch.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,9 +1,9 @@
 | 
			
		||||
---
 | 
			
		||||
name: "@types/node-fetch"
 | 
			
		||||
version: 2.5.12
 | 
			
		||||
version: 2.6.1
 | 
			
		||||
type: npm
 | 
			
		||||
summary: TypeScript definitions for node-fetch
 | 
			
		||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch
 | 
			
		||||
summary: 
 | 
			
		||||
homepage: 
 | 
			
		||||
license: mit
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										6
									
								
								.licenses/npm/@types/node.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.licenses/npm/@types/node.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,9 +1,9 @@
 | 
			
		||||
---
 | 
			
		||||
name: "@types/node"
 | 
			
		||||
version: 12.20.42
 | 
			
		||||
version: 16.11.26
 | 
			
		||||
type: npm
 | 
			
		||||
summary: TypeScript definitions for Node.js
 | 
			
		||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
 | 
			
		||||
summary: 
 | 
			
		||||
homepage: 
 | 
			
		||||
license: mit
 | 
			
		||||
licenses:
 | 
			
		||||
- sources: LICENSE
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										26
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								README.md
									
									
									
									
									
								
							@ -2,19 +2,23 @@
 | 
			
		||||
 | 
			
		||||
This action allows caching dependencies and build outputs to improve workflow execution time.
 | 
			
		||||
 | 
			
		||||
<a href="https://github.com/actions/cache/actions?query=workflow%3ATests"><img alt="GitHub Actions status" src="https://github.com/actions/cache/workflows/Tests/badge.svg?branch=main&event=push"></a>
 | 
			
		||||
[](https://github.com/actions/cache/actions/workflows/workflow.yml)
 | 
			
		||||
 | 
			
		||||
## Documentation
 | 
			
		||||
 | 
			
		||||
See ["Caching dependencies to speed up workflows"](https://help.github.com/github/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows).
 | 
			
		||||
 | 
			
		||||
## What's New
 | 
			
		||||
### v3
 | 
			
		||||
* Updated the minimum runner version support from node 12 -> node 16.
 | 
			
		||||
 | 
			
		||||
### v2
 | 
			
		||||
* Increased the cache size limit to 10 GB.
 | 
			
		||||
* Added support for multiple paths, [glob patterns](https://github.com/actions/toolkit/tree/main/packages/glob), and single file caches.
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- name: Cache multiple paths
 | 
			
		||||
  uses: actions/cache@v2
 | 
			
		||||
  uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/cache
 | 
			
		||||
@ -69,7 +73,7 @@ jobs:
 | 
			
		||||
 | 
			
		||||
    - name: Cache Primes
 | 
			
		||||
      id: cache-primes
 | 
			
		||||
      uses: actions/cache@v2
 | 
			
		||||
      uses: actions/cache@v3
 | 
			
		||||
      with:
 | 
			
		||||
        path: prime-numbers
 | 
			
		||||
        key: ${{ runner.os }}-primes
 | 
			
		||||
@ -88,11 +92,13 @@ Every programming language and framework has its own way of caching.
 | 
			
		||||
 | 
			
		||||
See [Examples](examples.md) for a list of `actions/cache` implementations for use with:
 | 
			
		||||
 | 
			
		||||
- [C# - Nuget](./examples.md#c---nuget)
 | 
			
		||||
- [C# - NuGet](./examples.md#c---nuget)
 | 
			
		||||
- [D - DUB](./examples.md#d---dub)
 | 
			
		||||
- [Deno](./examples.md#deno)
 | 
			
		||||
- [Elixir - Mix](./examples.md#elixir---mix)
 | 
			
		||||
- [Go - Modules](./examples.md#go---modules)
 | 
			
		||||
- [Haskell - Cabal](./examples.md#haskell---cabal)
 | 
			
		||||
- [Haskell - Stack](./examples.md#haskell---stack)
 | 
			
		||||
- [Java - Gradle](./examples.md#java---gradle)
 | 
			
		||||
- [Java - Maven](./examples.md#java---maven)
 | 
			
		||||
- [Node - npm](./examples.md#node---npm)
 | 
			
		||||
@ -117,7 +123,7 @@ A cache key can include any of the contexts, functions, literals, and operators
 | 
			
		||||
For example, using the [`hashFiles`](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#hashfiles) function allows you to create a new cache when dependencies change.
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
  - uses: actions/cache@v2
 | 
			
		||||
  - uses: actions/cache@v3
 | 
			
		||||
    with:
 | 
			
		||||
      path: |
 | 
			
		||||
        path/to/dependencies
 | 
			
		||||
@ -135,7 +141,7 @@ Additionally, you can use arbitrary command output in a cache key, such as a dat
 | 
			
		||||
      echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
 | 
			
		||||
    shell: bash
 | 
			
		||||
 | 
			
		||||
  - uses: actions/cache@v2
 | 
			
		||||
  - uses: actions/cache@v3
 | 
			
		||||
    with:
 | 
			
		||||
      path: path/to/dependencies
 | 
			
		||||
      key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/lockfiles') }}
 | 
			
		||||
@ -156,7 +162,7 @@ Example:
 | 
			
		||||
steps:
 | 
			
		||||
  - uses: actions/checkout@v2
 | 
			
		||||
 | 
			
		||||
  - uses: actions/cache@v2
 | 
			
		||||
  - uses: actions/cache@v3
 | 
			
		||||
    id: cache
 | 
			
		||||
    with:
 | 
			
		||||
      path: path/to/dependencies
 | 
			
		||||
@ -175,6 +181,12 @@ steps:
 | 
			
		||||
 | 
			
		||||
Since GitHub Enterprise Server uses self-hosted runners, dependencies are typically cached on the runner by whatever dependency management tool is being used (npm, maven, etc.).  This eliminates the need for explicit caching in some scenarios.
 | 
			
		||||
 | 
			
		||||
## Changelog schedule and history 
 | 
			
		||||
 | 
			
		||||
| Status  | Version  | Date  | Highlights  |
 | 
			
		||||
|:---|:---|:---|:---|
 | 
			
		||||
| Published  | v3.0.0  | Mar 21st, 2022 | -  Updated minimum runner version support from node 12 -> node 16 <br>  |
 | 
			
		||||
 | 
			
		||||
## Contributing
 | 
			
		||||
We would love for you to contribute to `actions/cache`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -18,7 +18,7 @@ outputs:
 | 
			
		||||
  cache-hit:
 | 
			
		||||
    description: 'A boolean value to indicate an exact match was found for the primary key'
 | 
			
		||||
runs:
 | 
			
		||||
  using: 'node12'
 | 
			
		||||
  using: 'node16'
 | 
			
		||||
  main: 'dist/restore/index.js'
 | 
			
		||||
  post: 'dist/save/index.js'
 | 
			
		||||
  post-if: 'success()'
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2420
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2420
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										2420
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2420
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										145
									
								
								examples.md
									
									
									
									
									
								
							
							
						
						
									
										145
									
								
								examples.md
									
									
									
									
									
								
							@ -4,17 +4,22 @@
 | 
			
		||||
- [D - DUB](#d---dub)
 | 
			
		||||
  - [POSIX](#posix)
 | 
			
		||||
  - [Windows](#windows)
 | 
			
		||||
- [Elixir - Mix](#elixir---mix)
 | 
			
		||||
- [Go - Modules](#go---modules)
 | 
			
		||||
- [Deno](#deno)
 | 
			
		||||
  - [Linux](#linux)
 | 
			
		||||
  - [macOS](#macos)
 | 
			
		||||
  - [Windows](#windows-1)
 | 
			
		||||
- [Elixir - Mix](#elixir---mix)
 | 
			
		||||
- [Go - Modules](#go---modules)
 | 
			
		||||
  - [Linux](#linux-1)
 | 
			
		||||
  - [macOS](#macos-1)
 | 
			
		||||
  - [Windows](#windows-2)
 | 
			
		||||
- [Haskell - Cabal](#haskell---cabal)
 | 
			
		||||
- [Haskell - Stack](#haskell---stack)
 | 
			
		||||
- [Java - Gradle](#java---gradle)
 | 
			
		||||
- [Java - Maven](#java---maven)
 | 
			
		||||
- [Node - npm](#node---npm)
 | 
			
		||||
  - [macOS and Ubuntu](#macos-and-ubuntu)
 | 
			
		||||
  - [Windows](#windows-2)
 | 
			
		||||
  - [Windows](#windows-3)
 | 
			
		||||
  - [Using multiple systems and `npm config`](#using-multiple-systems-and-npm-config)
 | 
			
		||||
- [Node - Lerna](#node---lerna)
 | 
			
		||||
- [Node - Yarn](#node---yarn)
 | 
			
		||||
@ -28,8 +33,6 @@
 | 
			
		||||
  - [Using pip to get cache location](#using-pip-to-get-cache-location)
 | 
			
		||||
- [Python - pipenv](#python---pipenv)
 | 
			
		||||
- [R - renv](#r---renv)
 | 
			
		||||
  - [Simple example](#simple-example-1)
 | 
			
		||||
  - [Multiple OS's in a workflow](#multiple-oss-in-a-workflow-1)
 | 
			
		||||
- [Ruby - Bundler](#ruby---bundler)
 | 
			
		||||
- [Rust - Cargo](#rust---cargo)
 | 
			
		||||
- [Scala - SBT](#scala---sbt)
 | 
			
		||||
@ -42,7 +45,7 @@
 | 
			
		||||
Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/.nuget/packages
 | 
			
		||||
    key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
 | 
			
		||||
@ -51,10 +54,10 @@ Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/packa
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Depending on the environment, huge packages might be pre-installed in the global cache folder.
 | 
			
		||||
With `actions/cache@v2` you can now exclude unwanted packages with [exclude pattern](https://github.com/actions/toolkit/tree/main/packages/glob#exclude-patterns)
 | 
			
		||||
With `actions/cache@v3` you can now exclude unwanted packages with [exclude pattern](https://github.com/actions/toolkit/tree/main/packages/glob#exclude-patterns)
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/.nuget/packages
 | 
			
		||||
@ -66,11 +69,12 @@ With `actions/cache@v2` you can now exclude unwanted packages with [exclude patt
 | 
			
		||||
 | 
			
		||||
Or you could move the cache folder like below.
 | 
			
		||||
>Note: This workflow does not work for projects that require files to be placed in user profile package folder
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
env:
 | 
			
		||||
  NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
 | 
			
		||||
steps:
 | 
			
		||||
  - uses: actions/cache@v2
 | 
			
		||||
  - uses: actions/cache@v3
 | 
			
		||||
    with:
 | 
			
		||||
      path: ${{ github.workspace }}/.nuget/packages
 | 
			
		||||
      key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
 | 
			
		||||
@ -83,7 +87,7 @@ steps:
 | 
			
		||||
### POSIX
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/.dub
 | 
			
		||||
    key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
 | 
			
		||||
@ -94,7 +98,7 @@ steps:
 | 
			
		||||
### Windows
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~\AppData\Local\dub
 | 
			
		||||
    key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
 | 
			
		||||
@ -102,10 +106,46 @@ steps:
 | 
			
		||||
      ${{ runner.os }}-dub-
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Deno
 | 
			
		||||
 | 
			
		||||
### Linux
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/.deno
 | 
			
		||||
      ~/.cache/deno
 | 
			
		||||
    key: ${{ runner.os }}-deno-${{ hashFiles('**/deps.ts') }}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### macOS
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/.deno
 | 
			
		||||
      ~/Library/Caches/deno
 | 
			
		||||
    key: ${{ runner.os }}-deno-${{ hashFiles('**/deps.ts') }}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Windows
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~\.deno
 | 
			
		||||
      %LocalAppData%\deno
 | 
			
		||||
    key: ${{ runner.os }}-deno-${{ hashFiles('**/deps.ts') }}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Elixir - Mix
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      deps
 | 
			
		||||
@ -120,7 +160,7 @@ steps:
 | 
			
		||||
### Linux
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/.cache/go-build
 | 
			
		||||
@ -133,7 +173,7 @@ steps:
 | 
			
		||||
### macOS
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/Library/Caches/go-build
 | 
			
		||||
@ -146,11 +186,11 @@ steps:
 | 
			
		||||
### Windows
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      %LocalAppData%\go-build
 | 
			
		||||
      ~/go/pkg/mod
 | 
			
		||||
      ~\AppData\Local\go-build
 | 
			
		||||
      ~\go\pkg\mod
 | 
			
		||||
    key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-go-
 | 
			
		||||
@ -162,7 +202,7 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
 | 
			
		||||
  uses: actions/cache@v2
 | 
			
		||||
  uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/.cabal/packages
 | 
			
		||||
@ -172,12 +212,31 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
 | 
			
		||||
    restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Haskell - Stack
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  name: Cache ~/.stack
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/.stack
 | 
			
		||||
    key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-stack-global-
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  name: Cache .stack-work
 | 
			
		||||
  with:
 | 
			
		||||
    path: .stack-work
 | 
			
		||||
    key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-stack-work-
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Java - Gradle
 | 
			
		||||
 | 
			
		||||
>Note: Ensure no Gradle daemons are running anymore when your workflow completes. Creating the cache package might fail due to locks being held by Gradle. Refer to the [Gradle Daemon documentation](https://docs.gradle.org/current/userguide/gradle_daemon.html) on how to disable or stop the Gradle Daemons.
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/.gradle/caches
 | 
			
		||||
@ -191,7 +250,7 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- name: Cache local Maven repository
 | 
			
		||||
  uses: actions/cache@v2
 | 
			
		||||
  uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/.m2/repository
 | 
			
		||||
    key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
 | 
			
		||||
@ -210,7 +269,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
 | 
			
		||||
### macOS and Ubuntu
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/.npm
 | 
			
		||||
    key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
 | 
			
		||||
@ -225,7 +284,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
 | 
			
		||||
  id: npm-cache
 | 
			
		||||
  run: |
 | 
			
		||||
    echo "::set-output name=dir::$(npm config get cache)"
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: ${{ steps.npm-cache.outputs.dir }}
 | 
			
		||||
    key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
 | 
			
		||||
@ -240,7 +299,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
 | 
			
		||||
  id: npm-cache-dir
 | 
			
		||||
  run: |
 | 
			
		||||
    echo "::set-output name=dir::$(npm config get cache)"
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
 | 
			
		||||
  with:
 | 
			
		||||
    path: ${{ steps.npm-cache-dir.outputs.dir }}
 | 
			
		||||
@ -253,11 +312,9 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- name: restore lerna
 | 
			
		||||
  uses: actions/cache@v2
 | 
			
		||||
  uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      node_modules
 | 
			
		||||
      */*/node_modules
 | 
			
		||||
    path: **/node_modules
 | 
			
		||||
    key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
@ -269,7 +326,7 @@ The yarn cache directory will depend on your operating system and version of `ya
 | 
			
		||||
  id: yarn-cache-dir-path
 | 
			
		||||
  run: echo "::set-output name=dir::$(yarn cache dir)"
 | 
			
		||||
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
 | 
			
		||||
  with:
 | 
			
		||||
    path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
 | 
			
		||||
@ -287,7 +344,7 @@ The yarn 2 cache directory will depend on your config. See https://yarnpkg.com/c
 | 
			
		||||
  id: yarn-cache-dir-path
 | 
			
		||||
  run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
 | 
			
		||||
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
 | 
			
		||||
  with:
 | 
			
		||||
    path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
 | 
			
		||||
@ -302,7 +359,7 @@ Esy allows you to export built dependencies and import pre-built dependencies.
 | 
			
		||||
```yaml
 | 
			
		||||
    - name: Restore Cache
 | 
			
		||||
      id: restore-cache
 | 
			
		||||
      uses: actions/cache@v2
 | 
			
		||||
      uses: actions/cache@v3
 | 
			
		||||
      with:
 | 
			
		||||
        path: _export
 | 
			
		||||
        key:  ${{ runner.os }}-esy-${{ hashFiles('esy.lock/index.json') }}
 | 
			
		||||
@ -331,7 +388,7 @@ Esy allows you to export built dependencies and import pre-built dependencies.
 | 
			
		||||
  id: composer-cache
 | 
			
		||||
  run: |
 | 
			
		||||
    echo "::set-output name=dir::$(composer config cache-files-dir)"
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: ${{ steps.composer-cache.outputs.dir }}
 | 
			
		||||
    key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
 | 
			
		||||
@ -352,7 +409,7 @@ Locations:
 | 
			
		||||
### Simple example
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/.cache/pip
 | 
			
		||||
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
			
		||||
@ -365,7 +422,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
 | 
			
		||||
### Multiple OS's in a workflow
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  if: startsWith(runner.os, 'Linux')
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/.cache/pip
 | 
			
		||||
@ -373,7 +430,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-pip-
 | 
			
		||||
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  if: startsWith(runner.os, 'macOS')
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/Library/Caches/pip
 | 
			
		||||
@ -381,7 +438,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-pip-
 | 
			
		||||
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  if: startsWith(runner.os, 'Windows')
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~\AppData\Local\pip\Cache
 | 
			
		||||
@ -407,7 +464,7 @@ jobs:
 | 
			
		||||
        - os: windows-latest
 | 
			
		||||
          path: ~\AppData\Local\pip\Cache
 | 
			
		||||
    steps:
 | 
			
		||||
    - uses: actions/cache@v2
 | 
			
		||||
    - uses: actions/cache@v3
 | 
			
		||||
      with:
 | 
			
		||||
        path: ${{ matrix.path }}
 | 
			
		||||
        key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
			
		||||
@ -425,7 +482,7 @@ jobs:
 | 
			
		||||
    echo "::set-output name=dir::$(pip cache dir)"
 | 
			
		||||
 | 
			
		||||
- name: pip cache
 | 
			
		||||
  uses: actions/cache@v2
 | 
			
		||||
  uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: ${{ steps.pip-cache.outputs.dir }}
 | 
			
		||||
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
			
		||||
@ -443,7 +500,7 @@ jobs:
 | 
			
		||||
 | 
			
		||||
  ⋮
 | 
			
		||||
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/.local/share/virtualenvs
 | 
			
		||||
    key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}
 | 
			
		||||
@ -470,7 +527,7 @@ For renv, the cache directory will vary by OS. The `RENV_PATHS_ROOT` environment
 | 
			
		||||
    cat("##[set-output name=r-version;]", R.Version()$version.string, sep = "")
 | 
			
		||||
  shell: Rscript {0}
 | 
			
		||||
- name: Restore Renv package cache
 | 
			
		||||
  uses: actions/cache@v2
 | 
			
		||||
  uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: ${{ env.RENV_PATHS_ROOT }}
 | 
			
		||||
    key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{ inputs.cache-version }}-${{ hashFiles('renv.lock') }}
 | 
			
		||||
@ -496,7 +553,7 @@ whenever possible:
 | 
			
		||||
## Rust - Cargo
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/.cargo/bin/
 | 
			
		||||
@ -511,7 +568,7 @@ whenever possible:
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- name: Cache SBT
 | 
			
		||||
  uses: actions/cache@v2
 | 
			
		||||
  uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/.ivy2/cache
 | 
			
		||||
@ -522,7 +579,7 @@ whenever possible:
 | 
			
		||||
## Swift, Objective-C - Carthage
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: Carthage
 | 
			
		||||
    key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
 | 
			
		||||
@ -533,7 +590,7 @@ whenever possible:
 | 
			
		||||
## Swift, Objective-C - CocoaPods
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: Pods
 | 
			
		||||
    key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
 | 
			
		||||
@ -544,7 +601,7 @@ whenever possible:
 | 
			
		||||
## Swift - Swift Package Manager
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
- uses: actions/cache@v3
 | 
			
		||||
  with:
 | 
			
		||||
    path: .build
 | 
			
		||||
    key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										11750
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										11750
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										28
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								package.json
									
									
									
									
									
								
							@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "cache",
 | 
			
		||||
  "version": "2.1.7",
 | 
			
		||||
  "version": "3.0.0",
 | 
			
		||||
  "private": true,
 | 
			
		||||
  "description": "Cache dependencies and build outputs",
 | 
			
		||||
  "main": "dist/restore/index.js",
 | 
			
		||||
@ -23,28 +23,28 @@
 | 
			
		||||
  "author": "GitHub",
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@actions/cache": "^1.0.9",
 | 
			
		||||
    "@actions/cache": "file:actions-cache-1.0.10.tgz",
 | 
			
		||||
    "@actions/core": "^1.2.6",
 | 
			
		||||
    "@actions/exec": "^1.0.1",
 | 
			
		||||
    "@actions/io": "^1.1.0"
 | 
			
		||||
    "@actions/exec": "^1.1.1",
 | 
			
		||||
    "@actions/io": "^1.1.2"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@types/jest": "^27.4.0",
 | 
			
		||||
    "@types/jest": "^27.4.1",
 | 
			
		||||
    "@types/nock": "^11.1.0",
 | 
			
		||||
    "@types/node": "^12.20.42",
 | 
			
		||||
    "@typescript-eslint/eslint-plugin": "^5.10.1",
 | 
			
		||||
    "@typescript-eslint/parser": "^5.10.1",
 | 
			
		||||
    "@types/node": "^16.11.26",
 | 
			
		||||
    "@typescript-eslint/eslint-plugin": "^5.15.0",
 | 
			
		||||
    "@typescript-eslint/parser": "^5.15.0",
 | 
			
		||||
    "@zeit/ncc": "^0.20.5",
 | 
			
		||||
    "eslint": "^8.8.0",
 | 
			
		||||
    "eslint-config-prettier": "^8.3.0",
 | 
			
		||||
    "eslint": "^8.11.0",
 | 
			
		||||
    "eslint-config-prettier": "^8.5.0",
 | 
			
		||||
    "eslint-plugin-import": "^2.25.4",
 | 
			
		||||
    "eslint-plugin-jest": "^26.0.0",
 | 
			
		||||
    "eslint-plugin-jest": "^26.1.2",
 | 
			
		||||
    "eslint-plugin-prettier": "^4.0.0",
 | 
			
		||||
    "eslint-plugin-simple-import-sort": "^7.0.0",
 | 
			
		||||
    "jest": "^27.4.7",
 | 
			
		||||
    "jest-circus": "^27.4.6",
 | 
			
		||||
    "jest": "^27.5.1",
 | 
			
		||||
    "jest-circus": "^27.5.1",
 | 
			
		||||
    "nock": "^11.7.0",
 | 
			
		||||
    "prettier": "^2.5.1",
 | 
			
		||||
    "prettier": "^2.6.0",
 | 
			
		||||
    "ts-jest": "^27.1.3",
 | 
			
		||||
    "typescript": "^3.9.9"
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user