mirror of
				https://github.com/actions/cache.git
				synced 2025-11-03 00:25:49 +07:00 
			
		
		
		
	Compare commits
	
		
			58 Commits
		
	
	
		
			resolve-de
			...
			vsvipul/al
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| bdb21a7177 | |||
| d55d005ab0 | |||
| b44d6c5cbf | |||
| 60742c2acf | |||
| 12086c7bbf | |||
| 626c44ce85 | |||
| f2d5621efc | |||
| cab6d27614 | |||
| 69811fd677 | |||
| 887b9060fe | |||
| c6762fdd6a | |||
| 95c3ae75f4 | |||
| 797382fe42 | |||
| 36dbd93a7c | |||
| 45f362d0ca | |||
| ca0688b4ab | |||
| ef8498dcba | |||
| 8f1e2e0286 | |||
| 48af2dc4a9 | |||
| f63a711791 | |||
| 770a27cf65 | |||
| c2131abcd8 | |||
| 575160481d | |||
| 136d96b4ae | |||
| 7d4f40b464 | |||
| 2d8d0d1c9b | |||
| 7799d864d9 | |||
| 4b0cf6cc46 | |||
| 60c606a2b4 | |||
| b6e9a919a7 | |||
| c842503583 | |||
| 2b7da2a62c | |||
| deae296ab3 | |||
| c7c46bcb6d | |||
| 6535c5fb5f | |||
| 3fdafa472e | |||
| 341e6d75d9 | |||
| 3fe001f5ca | |||
| ab4bea262c | |||
| 7772fcab79 | |||
| 6c2ab9416b | |||
| 2c7b30f330 | |||
| 73cb7e0405 | |||
| 757c5a8ca4 | |||
| 4e817c1f42 | |||
| 72d1e4fdff | |||
| 8e70c71aee | |||
| 4d3516739c | |||
| 9c2f1a93d4 | |||
| 5df1ae880d | |||
| 45bb0b1552 | |||
| b32c91dfec | |||
| de7c17c6a9 | |||
| 447f0fd1d3 | |||
| 47e8bd685f | |||
| 795a8f09a9 | |||
| 4762de4681 | |||
| 12ed05f49a | 
							
								
								
									
										17
									
								
								.github/auto_assign.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								.github/auto_assign.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,17 @@
 | 
				
			|||||||
 | 
					# Set to true to add reviewers to pull requests
 | 
				
			||||||
 | 
					addReviewers: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Set to true to add assignees to pull requests
 | 
				
			||||||
 | 
					addAssignees: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# A list of reviewers to be added to pull requests (GitHub user name)
 | 
				
			||||||
 | 
					reviewers:
 | 
				
			||||||
 | 
					  - phantsure
 | 
				
			||||||
 | 
					  - aparna-ravindra
 | 
				
			||||||
 | 
					  - tiwarishub
 | 
				
			||||||
 | 
					  - vsvipul
 | 
				
			||||||
 | 
					  - bishal-pdmsft
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# A number of reviewers added to the pull request
 | 
				
			||||||
 | 
					# Set 0 to add all the reviewers (default: 0)
 | 
				
			||||||
 | 
					numberOfReviewers: 1
 | 
				
			||||||
							
								
								
									
										15
									
								
								.github/workflows/auto-assign-issues.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								.github/workflows/auto-assign-issues.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,15 @@
 | 
				
			|||||||
 | 
					name: Issue assignment
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					    issues:
 | 
				
			||||||
 | 
					        types: [opened]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					    auto-assign:
 | 
				
			||||||
 | 
					        runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					        steps:
 | 
				
			||||||
 | 
					            - name: 'Auto-assign issue'
 | 
				
			||||||
 | 
					              uses: pozil/auto-assign-issue@v1.4.0
 | 
				
			||||||
 | 
					              with:
 | 
				
			||||||
 | 
					                  assignees: phantsure,tiwarishub,aparna-ravindra,vsvipul,bishal-pdmsft
 | 
				
			||||||
 | 
					                  numOfAssignee: 1
 | 
				
			||||||
							
								
								
									
										10
									
								
								.github/workflows/auto-assign.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								.github/workflows/auto-assign.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,10 @@
 | 
				
			|||||||
 | 
					name: 'Auto Assign'
 | 
				
			||||||
 | 
					on:
 | 
				
			||||||
 | 
					  pull_request:
 | 
				
			||||||
 | 
					    types: [opened, ready_for_review]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					jobs:
 | 
				
			||||||
 | 
					  add-reviews:
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - uses: kentaro-m/auto-assign-action@v1.2.1
 | 
				
			||||||
							
								
								
									
										13
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										13
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
								
							@ -22,16 +22,13 @@ jobs:
 | 
				
			|||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - uses: actions/checkout@v2
 | 
					      - uses: actions/checkout@v3
 | 
				
			||||||
 | 
					      - name: Setup Node.js 16.x
 | 
				
			||||||
      - name: Set Node.js 12.x
 | 
					        uses: actions/setup-node@v3
 | 
				
			||||||
        uses: actions/setup-node@v1
 | 
					 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          node-version: 12.x
 | 
					          node-version: 16.x
 | 
				
			||||||
 | 
					 | 
				
			||||||
      - name: Install dependencies
 | 
					      - name: Install dependencies
 | 
				
			||||||
        run: npm ci
 | 
					        run: npm ci
 | 
				
			||||||
 | 
					 | 
				
			||||||
      - name: Rebuild the dist/ directory
 | 
					      - name: Rebuild the dist/ directory
 | 
				
			||||||
        run: npm run build
 | 
					        run: npm run build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -45,7 +42,7 @@ jobs:
 | 
				
			|||||||
        id: diff
 | 
					        id: diff
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      # If index.js was different than expected, upload the expected version as an artifact
 | 
					      # If index.js was different than expected, upload the expected version as an artifact
 | 
				
			||||||
      - uses: actions/upload-artifact@v2
 | 
					      - uses: actions/upload-artifact@v3
 | 
				
			||||||
        if: ${{ failure() && steps.diff.conclusion == 'failure' }}
 | 
					        if: ${{ failure() && steps.diff.conclusion == 'failure' }}
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          name: dist
 | 
					          name: dist
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										4
									
								
								.github/workflows/close-inactive-issues.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/close-inactive-issues.yml
									
									
									
									
										vendored
									
									
								
							@ -12,10 +12,10 @@ jobs:
 | 
				
			|||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - uses: actions/stale@v3
 | 
					      - uses: actions/stale@v3
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          days-before-issue-stale: 365
 | 
					          days-before-issue-stale: 200
 | 
				
			||||||
          days-before-issue-close: 5
 | 
					          days-before-issue-close: 5
 | 
				
			||||||
          stale-issue-label: "stale"
 | 
					          stale-issue-label: "stale"
 | 
				
			||||||
          stale-issue-message: "This issue is stale because it has been open for 365 days with no activity. Leave a comment to avoid closing this issue in 5 days."
 | 
					          stale-issue-message: "This issue is stale because it has been open for 200 days with no activity. Leave a comment to avoid closing this issue in 5 days."
 | 
				
			||||||
          close-issue-message: "This issue was closed because it has been inactive for 5 days since being marked as stale."
 | 
					          close-issue-message: "This issue was closed because it has been inactive for 5 days since being marked as stale."
 | 
				
			||||||
          days-before-pr-stale: -1
 | 
					          days-before-pr-stale: -1
 | 
				
			||||||
          days-before-pr-close: -1
 | 
					          days-before-pr-close: -1
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										4
									
								
								.github/workflows/codeql.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/codeql.yml
									
									
									
									
										vendored
									
									
								
							@ -14,7 +14,7 @@ jobs:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - name: Checkout repository
 | 
					    - name: Checkout repository
 | 
				
			||||||
      uses: actions/checkout@v2
 | 
					      uses: actions/checkout@v3
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
        # We must fetch at least the immediate parents so that if this is
 | 
					        # We must fetch at least the immediate parents so that if this is
 | 
				
			||||||
        # a pull request then we can checkout the head.
 | 
					        # a pull request then we can checkout the head.
 | 
				
			||||||
@ -24,7 +24,7 @@ jobs:
 | 
				
			|||||||
    # the head of the pull request instead of the merge commit.
 | 
					    # the head of the pull request instead of the merge commit.
 | 
				
			||||||
    - run: git checkout HEAD^2
 | 
					    - run: git checkout HEAD^2
 | 
				
			||||||
      if: ${{ github.event_name == 'pull_request' }}
 | 
					      if: ${{ github.event_name == 'pull_request' }}
 | 
				
			||||||
      
 | 
					
 | 
				
			||||||
    # Initializes the CodeQL tools for scanning.
 | 
					    # Initializes the CodeQL tools for scanning.
 | 
				
			||||||
    - name: Initialize CodeQL
 | 
					    - name: Initialize CodeQL
 | 
				
			||||||
      uses: github/codeql-action/init@v1
 | 
					      uses: github/codeql-action/init@v1
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.github/workflows/licensed.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/licensed.yml
									
									
									
									
										vendored
									
									
								
							@ -13,7 +13,7 @@ jobs:
 | 
				
			|||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
    name: Check licenses
 | 
					    name: Check licenses
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
      - uses: actions/checkout@v2
 | 
					      - uses: actions/checkout@v3
 | 
				
			||||||
      - run: npm ci
 | 
					      - run: npm ci
 | 
				
			||||||
      - name: Install licensed
 | 
					      - name: Install licensed
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										18
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										18
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							@ -24,17 +24,17 @@ jobs:
 | 
				
			|||||||
    runs-on: ${{ matrix.os }}
 | 
					    runs-on: ${{ matrix.os }}
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - name: Checkout
 | 
					    - name: Checkout
 | 
				
			||||||
      uses: actions/checkout@v2
 | 
					      uses: actions/checkout@v3
 | 
				
			||||||
    - name: Setup Node.js
 | 
					    - name: Setup Node.js 16.x
 | 
				
			||||||
      uses: actions/setup-node@v1
 | 
					      uses: actions/setup-node@v3
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
        node-version: '12.x'
 | 
					        node-version: 16.x
 | 
				
			||||||
    - name: Determine npm cache directory
 | 
					    - name: Determine npm cache directory
 | 
				
			||||||
      id: npm-cache
 | 
					      id: npm-cache
 | 
				
			||||||
      run: |
 | 
					      run: |
 | 
				
			||||||
        echo "::set-output name=dir::$(npm config get cache)"
 | 
					        echo "::set-output name=dir::$(npm config get cache)"
 | 
				
			||||||
    - name: Restore npm cache
 | 
					    - name: Restore npm cache
 | 
				
			||||||
      uses: actions/cache@v2
 | 
					      uses: actions/cache@v3
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
        path: ${{ steps.npm-cache.outputs.dir }}
 | 
					        path: ${{ steps.npm-cache.outputs.dir }}
 | 
				
			||||||
        key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
 | 
					        key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
 | 
				
			||||||
@ -57,7 +57,7 @@ jobs:
 | 
				
			|||||||
    runs-on: ${{ matrix.os }}
 | 
					    runs-on: ${{ matrix.os }}
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - name: Checkout
 | 
					    - name: Checkout
 | 
				
			||||||
      uses: actions/checkout@v2
 | 
					      uses: actions/checkout@v3
 | 
				
			||||||
    - name: Generate files in working directory
 | 
					    - name: Generate files in working directory
 | 
				
			||||||
      shell: bash
 | 
					      shell: bash
 | 
				
			||||||
      run: __tests__/create-cache-files.sh ${{ runner.os }} test-cache
 | 
					      run: __tests__/create-cache-files.sh ${{ runner.os }} test-cache
 | 
				
			||||||
@ -80,7 +80,7 @@ jobs:
 | 
				
			|||||||
    runs-on: ${{ matrix.os }}
 | 
					    runs-on: ${{ matrix.os }}
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - name: Checkout
 | 
					    - name: Checkout
 | 
				
			||||||
      uses: actions/checkout@v2
 | 
					      uses: actions/checkout@v3
 | 
				
			||||||
    - name: Restore cache
 | 
					    - name: Restore cache
 | 
				
			||||||
      uses: ./
 | 
					      uses: ./
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
@ -110,7 +110,7 @@ jobs:
 | 
				
			|||||||
      https_proxy: http://squid-proxy:3128
 | 
					      https_proxy: http://squid-proxy:3128
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - name: Checkout
 | 
					    - name: Checkout
 | 
				
			||||||
      uses: actions/checkout@v2
 | 
					      uses: actions/checkout@v3
 | 
				
			||||||
    - name: Generate files
 | 
					    - name: Generate files
 | 
				
			||||||
      run: __tests__/create-cache-files.sh proxy test-cache
 | 
					      run: __tests__/create-cache-files.sh proxy test-cache
 | 
				
			||||||
    - name: Save cache
 | 
					    - name: Save cache
 | 
				
			||||||
@ -133,7 +133,7 @@ jobs:
 | 
				
			|||||||
      https_proxy: http://squid-proxy:3128
 | 
					      https_proxy: http://squid-proxy:3128
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - name: Checkout
 | 
					    - name: Checkout
 | 
				
			||||||
      uses: actions/checkout@v2
 | 
					      uses: actions/checkout@v3
 | 
				
			||||||
    - name: Restore cache
 | 
					    - name: Restore cache
 | 
				
			||||||
      uses: ./
 | 
					      uses: ./
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										6
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,9 +1,9 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
name: "@actions/cache"
 | 
					name: "@actions/cache"
 | 
				
			||||||
version: 1.0.8
 | 
					version: 2.0.2
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Actions cache lib
 | 
					summary: 
 | 
				
			||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/cache
 | 
					homepage: 
 | 
				
			||||||
license: mit
 | 
					license: mit
 | 
				
			||||||
licenses:
 | 
					licenses:
 | 
				
			||||||
- sources: LICENSE.md
 | 
					- sources: LICENSE.md
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.licenses/npm/@actions/core.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@actions/core.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,6 +1,6 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
name: "@actions/core"
 | 
					name: "@actions/core"
 | 
				
			||||||
version: 1.6.0
 | 
					version: 1.7.0
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Actions core lib
 | 
					summary: Actions core lib
 | 
				
			||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/core
 | 
					homepage: https://github.com/actions/toolkit/tree/main/packages/core
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										6
									
								
								.licenses/npm/@actions/exec.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.licenses/npm/@actions/exec.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,9 +1,9 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
name: "@actions/exec"
 | 
					name: "@actions/exec"
 | 
				
			||||||
version: 1.1.0
 | 
					version: 1.1.1
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Actions exec lib
 | 
					summary: 
 | 
				
			||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/exec
 | 
					homepage: 
 | 
				
			||||||
license: mit
 | 
					license: mit
 | 
				
			||||||
licenses:
 | 
					licenses:
 | 
				
			||||||
- sources: LICENSE.md
 | 
					- 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"
 | 
					name: "@actions/io"
 | 
				
			||||||
version: 1.1.1
 | 
					version: 1.1.2
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Actions io lib
 | 
					summary: 
 | 
				
			||||||
homepage: https://github.com/actions/toolkit/tree/main/packages/io
 | 
					homepage: 
 | 
				
			||||||
license: mit
 | 
					license: mit
 | 
				
			||||||
licenses:
 | 
					licenses:
 | 
				
			||||||
- sources: LICENSE.md
 | 
					- sources: LICENSE.md
 | 
				
			||||||
 | 
				
			|||||||
@ -1,9 +1,9 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
name: "@azure/core-asynciterator-polyfill"
 | 
					name: "@azure/core-asynciterator-polyfill"
 | 
				
			||||||
version: 1.0.0
 | 
					version: 1.0.2
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Polyfill for IE/Node 8 for Symbol.asyncIterator
 | 
					summary: 
 | 
				
			||||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-asynciterator-polyfill
 | 
					homepage: 
 | 
				
			||||||
license: mit
 | 
					license: mit
 | 
				
			||||||
licenses:
 | 
					licenses:
 | 
				
			||||||
- sources: LICENSE
 | 
					- sources: LICENSE
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.licenses/npm/@azure/core-http.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@azure/core-http.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,6 +1,6 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
name: "@azure/core-http"
 | 
					name: "@azure/core-http"
 | 
				
			||||||
version: 2.2.2
 | 
					version: 2.2.4
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
 | 
					summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
 | 
				
			||||||
  libraries generated using AutoRest
 | 
					  libraries generated using AutoRest
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										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"
 | 
					name: "@azure/core-lro"
 | 
				
			||||||
version: 2.2.1
 | 
					version: 2.2.4
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Isomorphic client library for supporting long-running operations in node.js
 | 
					summary: 
 | 
				
			||||||
  and browser.
 | 
					homepage: 
 | 
				
			||||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/README.md
 | 
					 | 
				
			||||||
license: mit
 | 
					license: mit
 | 
				
			||||||
licenses:
 | 
					licenses:
 | 
				
			||||||
- sources: LICENSE
 | 
					- sources: LICENSE
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.licenses/npm/@azure/core-paging.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@azure/core-paging.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,6 +1,6 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
name: "@azure/core-paging"
 | 
					name: "@azure/core-paging"
 | 
				
			||||||
version: 1.2.0
 | 
					version: 1.2.1
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Core types for paging async iterable iterators
 | 
					summary: Core types for paging async iterable iterators
 | 
				
			||||||
homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-paging/README.md
 | 
					homepage: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-paging/README.md
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										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"
 | 
					name: "@azure/ms-rest-js"
 | 
				
			||||||
version: 2.6.0
 | 
					version: 2.6.1
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Isomorphic client Runtime for Typescript/node.js/browser javascript client
 | 
					summary: 
 | 
				
			||||||
  libraries generated using AutoRest
 | 
					homepage: 
 | 
				
			||||||
homepage: https://github.com/Azure/ms-rest-js
 | 
					 | 
				
			||||||
license: mit
 | 
					license: mit
 | 
				
			||||||
licenses:
 | 
					licenses:
 | 
				
			||||||
- sources: LICENSE
 | 
					- 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"
 | 
					name: "@azure/storage-blob"
 | 
				
			||||||
version: 12.8.0
 | 
					version: 12.9.0
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Microsoft Azure Storage SDK for JavaScript - Blob
 | 
					summary: 
 | 
				
			||||||
homepage: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/storage/storage-blob/
 | 
					homepage: 
 | 
				
			||||||
license: mit
 | 
					license: mit
 | 
				
			||||||
licenses:
 | 
					licenses:
 | 
				
			||||||
- sources: LICENSE
 | 
					- sources: LICENSE
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										6
									
								
								.licenses/npm/@opentelemetry/api.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										6
									
								
								.licenses/npm/@opentelemetry/api.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,6 +1,6 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
name: "@opentelemetry/api"
 | 
					name: "@opentelemetry/api"
 | 
				
			||||||
version: 1.0.3
 | 
					version: 1.0.4
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: Public API for OpenTelemetry
 | 
					summary: Public API for OpenTelemetry
 | 
				
			||||||
homepage: https://github.com/open-telemetry/opentelemetry-js-api#readme
 | 
					homepage: https://github.com/open-telemetry/opentelemetry-js-api#readme
 | 
				
			||||||
@ -218,10 +218,6 @@ licenses:
 | 
				
			|||||||
    [discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
 | 
					    [discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
 | 
				
			||||||
    [license-url]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/LICENSE
 | 
					    [license-url]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/LICENSE
 | 
				
			||||||
    [license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
 | 
					    [license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
 | 
				
			||||||
    [dependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js-api.svg
 | 
					 | 
				
			||||||
    [dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-api
 | 
					 | 
				
			||||||
    [devDependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js-api.svg?type=dev
 | 
					 | 
				
			||||||
    [devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js-api?type=dev
 | 
					 | 
				
			||||||
    [npm-url]: https://www.npmjs.com/package/@opentelemetry/api
 | 
					    [npm-url]: https://www.npmjs.com/package/@opentelemetry/api
 | 
				
			||||||
    [npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fapi.svg
 | 
					    [npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fapi.svg
 | 
				
			||||||
    [docs-tracing]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/docs/tracing.md
 | 
					    [docs-tracing]: https://github.com/open-telemetry/opentelemetry-js-api/blob/main/docs/tracing.md
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										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"
 | 
					name: "@types/node-fetch"
 | 
				
			||||||
version: 2.5.12
 | 
					version: 2.6.1
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: TypeScript definitions for node-fetch
 | 
					summary: 
 | 
				
			||||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node-fetch
 | 
					homepage: 
 | 
				
			||||||
license: mit
 | 
					license: mit
 | 
				
			||||||
licenses:
 | 
					licenses:
 | 
				
			||||||
- sources: LICENSE
 | 
					- sources: LICENSE
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.licenses/npm/@types/node.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/@types/node.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,6 +1,6 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
name: "@types/node"
 | 
					name: "@types/node"
 | 
				
			||||||
version: 12.20.37
 | 
					version: 16.11.33
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: TypeScript definitions for Node.js
 | 
					summary: TypeScript definitions for Node.js
 | 
				
			||||||
homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
 | 
					homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.licenses/npm/node-fetch.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								.licenses/npm/node-fetch.dep.yml
									
									
									
										generated
									
									
									
								
							@ -1,6 +1,6 @@
 | 
				
			|||||||
---
 | 
					---
 | 
				
			||||||
name: node-fetch
 | 
					name: node-fetch
 | 
				
			||||||
version: 2.6.6
 | 
					version: 2.6.7
 | 
				
			||||||
type: npm
 | 
					type: npm
 | 
				
			||||||
summary: A light-weight module that brings window.fetch to node.js
 | 
					summary: A light-weight module that brings window.fetch to node.js
 | 
				
			||||||
homepage: https://github.com/bitinn/node-fetch
 | 
					homepage: https://github.com/bitinn/node-fetch
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										42
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										42
									
								
								README.md
									
									
									
									
									
								
							@ -2,19 +2,25 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
This action allows caching dependencies and build outputs to improve workflow execution time.
 | 
					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
 | 
					## 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).
 | 
					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
 | 
					## What's New
 | 
				
			||||||
 | 
					### v3
 | 
				
			||||||
 | 
					* Added support for caching from GHES 3.5.
 | 
				
			||||||
 | 
					* Fixed download issue for files > 2GB during restore.
 | 
				
			||||||
 | 
					* Updated the minimum runner version support from node 12 -> node 16.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* Added support for multiple paths, [glob patterns](https://github.com/actions/toolkit/tree/main/packages/glob), and single file caches. 
 | 
					### 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
 | 
					```yaml
 | 
				
			||||||
- name: Cache multiple paths
 | 
					- name: Cache multiple paths
 | 
				
			||||||
  uses: actions/cache@v2
 | 
					  uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: |
 | 
					    path: |
 | 
				
			||||||
      ~/cache
 | 
					      ~/cache
 | 
				
			||||||
@ -38,7 +44,7 @@ If you are using this inside a container, a POSIX-compliant `tar` needs to be in
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### Inputs
 | 
					### Inputs
 | 
				
			||||||
 | 
					
 | 
				
			||||||
* `path` - A list of files, directories, and wildcard patterns to cache and restore. See [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns. 
 | 
					* `path` - A list of files, directories, and wildcard patterns to cache and restore. See [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns.
 | 
				
			||||||
* `key` - An explicit key for restoring and saving the cache
 | 
					* `key` - An explicit key for restoring and saving the cache
 | 
				
			||||||
* `restore-keys` - An ordered list of keys to use for restoring the cache if no cache hit occurred for key
 | 
					* `restore-keys` - An ordered list of keys to use for restoring the cache if no cache hit occurred for key
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -49,7 +55,7 @@ If you are using this inside a container, a POSIX-compliant `tar` needs to be in
 | 
				
			|||||||
> See [Skipping steps based on cache-hit](#Skipping-steps-based-on-cache-hit) for info on using this output
 | 
					> See [Skipping steps based on cache-hit](#Skipping-steps-based-on-cache-hit) for info on using this output
 | 
				
			||||||
 | 
					
 | 
				
			||||||
### Cache scopes
 | 
					### Cache scopes
 | 
				
			||||||
The cache is scoped to the key and branch. The default branch cache is available to other branches. 
 | 
					The cache is scoped to the key and branch. The default branch cache is available to other branches.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
See [Matching a cache key](https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key) for more info.
 | 
					See [Matching a cache key](https://help.github.com/en/actions/configuring-and-managing-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key) for more info.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -65,11 +71,11 @@ jobs:
 | 
				
			|||||||
    runs-on: ubuntu-latest
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - uses: actions/checkout@v2
 | 
					    - uses: actions/checkout@v3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    - name: Cache Primes
 | 
					    - name: Cache Primes
 | 
				
			||||||
      id: cache-primes
 | 
					      id: cache-primes
 | 
				
			||||||
      uses: actions/cache@v2
 | 
					      uses: actions/cache@v3
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
        path: prime-numbers
 | 
					        path: prime-numbers
 | 
				
			||||||
        key: ${{ runner.os }}-primes
 | 
					        key: ${{ runner.os }}-primes
 | 
				
			||||||
@ -88,11 +94,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:
 | 
					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)
 | 
					- [D - DUB](./examples.md#d---dub)
 | 
				
			||||||
 | 
					- [Deno](./examples.md#deno)
 | 
				
			||||||
- [Elixir - Mix](./examples.md#elixir---mix)
 | 
					- [Elixir - Mix](./examples.md#elixir---mix)
 | 
				
			||||||
- [Go - Modules](./examples.md#go---modules)
 | 
					- [Go - Modules](./examples.md#go---modules)
 | 
				
			||||||
- [Haskell - Cabal](./examples.md#haskell---cabal)
 | 
					- [Haskell - Cabal](./examples.md#haskell---cabal)
 | 
				
			||||||
 | 
					- [Haskell - Stack](./examples.md#haskell---stack)
 | 
				
			||||||
- [Java - Gradle](./examples.md#java---gradle)
 | 
					- [Java - Gradle](./examples.md#java---gradle)
 | 
				
			||||||
- [Java - Maven](./examples.md#java---maven)
 | 
					- [Java - Maven](./examples.md#java---maven)
 | 
				
			||||||
- [Node - npm](./examples.md#node---npm)
 | 
					- [Node - npm](./examples.md#node---npm)
 | 
				
			||||||
@ -117,11 +125,11 @@ 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.
 | 
					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
 | 
					```yaml
 | 
				
			||||||
  - uses: actions/cache@v2
 | 
					  - uses: actions/cache@v3
 | 
				
			||||||
    with:
 | 
					    with:
 | 
				
			||||||
      path: | 
 | 
					      path: |
 | 
				
			||||||
        path/to/dependencies
 | 
					        path/to/dependencies
 | 
				
			||||||
        some/other/dependencies 
 | 
					        some/other/dependencies
 | 
				
			||||||
      key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
 | 
					      key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
 | 
				
			||||||
```
 | 
					```
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -135,7 +143,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")"
 | 
					      echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
 | 
				
			||||||
    shell: bash
 | 
					    shell: bash
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - uses: actions/cache@v2
 | 
					  - uses: actions/cache@v3
 | 
				
			||||||
    with:
 | 
					    with:
 | 
				
			||||||
      path: path/to/dependencies
 | 
					      path: path/to/dependencies
 | 
				
			||||||
      key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/lockfiles') }}
 | 
					      key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/lockfiles') }}
 | 
				
			||||||
@ -154,9 +162,9 @@ Using the `cache-hit` output, subsequent steps (such as install or build) can be
 | 
				
			|||||||
Example:
 | 
					Example:
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
steps:
 | 
					steps:
 | 
				
			||||||
  - uses: actions/checkout@v2
 | 
					  - uses: actions/checkout@v3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - uses: actions/cache@v2
 | 
					  - uses: actions/cache@v3
 | 
				
			||||||
    id: cache
 | 
					    id: cache
 | 
				
			||||||
    with:
 | 
					    with:
 | 
				
			||||||
      path: path/to/dependencies
 | 
					      path: path/to/dependencies
 | 
				
			||||||
@ -169,12 +177,6 @@ steps:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
> Note: The `id` defined in `actions/cache` must match the `id` in the `if` statement (i.e. `steps.[ID].outputs.cache-hit`)
 | 
					> Note: The `id` defined in `actions/cache` must match the `id` in the `if` statement (i.e. `steps.[ID].outputs.cache-hit`)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
## Known limitation
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
- `action/cache` is currently not supported on GitHub Enterprise Server. <https://github.com/github/roadmap/issues/273> is tracking this.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
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.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
## Contributing
 | 
					## 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.
 | 
					We would love for you to contribute to `actions/cache`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										8
									
								
								RELEASES.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								RELEASES.md
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,8 @@
 | 
				
			|||||||
 | 
					# Releases
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### 3.0.0
 | 
				
			||||||
 | 
					- Updated minimum runner version support from node 12 -> node 16
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					### 3.0.1
 | 
				
			||||||
 | 
					- Added support for caching from GHES 3.5.
 | 
				
			||||||
 | 
					- Fixed download issue for files > 2GB during restore.
 | 
				
			||||||
@ -1,3 +1,4 @@
 | 
				
			|||||||
 | 
					import * as cache from "@actions/cache";
 | 
				
			||||||
import * as core from "@actions/core";
 | 
					import * as core from "@actions/core";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { Events, Outputs, RefKey, State } from "../src/constants";
 | 
					import { Events, Outputs, RefKey, State } from "../src/constants";
 | 
				
			||||||
@ -5,6 +6,7 @@ import * as actionUtils from "../src/utils/actionUtils";
 | 
				
			|||||||
import * as testUtils from "../src/utils/testUtils";
 | 
					import * as testUtils from "../src/utils/testUtils";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
jest.mock("@actions/core");
 | 
					jest.mock("@actions/core");
 | 
				
			||||||
 | 
					jest.mock("@actions/cache");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
beforeAll(() => {
 | 
					beforeAll(() => {
 | 
				
			||||||
    jest.spyOn(core, "getInput").mockImplementation((name, options) => {
 | 
					    jest.spyOn(core, "getInput").mockImplementation((name, options) => {
 | 
				
			||||||
@ -26,7 +28,7 @@ test("isGhes returns true if server url is not github.com", () => {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test("isGhes returns true when server url is github.com", () => {
 | 
					test("isGhes returns false when server url is github.com", () => {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        process.env["GITHUB_SERVER_URL"] = "http://github.com";
 | 
					        process.env["GITHUB_SERVER_URL"] = "http://github.com";
 | 
				
			||||||
        expect(actionUtils.isGhes()).toBe(false);
 | 
					        expect(actionUtils.isGhes()).toBe(false);
 | 
				
			||||||
@ -232,3 +234,41 @@ test("getInputAsInt throws if required and value missing", () => {
 | 
				
			|||||||
        actionUtils.getInputAsInt("undefined", { required: true })
 | 
					        actionUtils.getInputAsInt("undefined", { required: true })
 | 
				
			||||||
    ).toThrowError();
 | 
					    ).toThrowError();
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test("isCacheFeatureAvailable for ac enabled", () => {
 | 
				
			||||||
 | 
					    jest.spyOn(cache, "isFeatureAvailable").mockImplementation(() => true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    expect(actionUtils.isCacheFeatureAvailable()).toBe(true);
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test("isCacheFeatureAvailable for ac disabled on GHES", () => {
 | 
				
			||||||
 | 
					    jest.spyOn(cache, "isFeatureAvailable").mockImplementation(() => false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const message =
 | 
				
			||||||
 | 
					        "Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.";
 | 
				
			||||||
 | 
					    const infoMock = jest.spyOn(core, "info");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					        process.env["GITHUB_SERVER_URL"] = "http://example.com";
 | 
				
			||||||
 | 
					        expect(actionUtils.isCacheFeatureAvailable()).toBe(false);
 | 
				
			||||||
 | 
					        expect(infoMock).toHaveBeenCalledWith(`[warning]${message}`);
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					        delete process.env["GITHUB_SERVER_URL"];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test("isCacheFeatureAvailable for ac disabled on dotcom", () => {
 | 
				
			||||||
 | 
					    jest.spyOn(cache, "isFeatureAvailable").mockImplementation(() => false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const message =
 | 
				
			||||||
 | 
					        "An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.";
 | 
				
			||||||
 | 
					    const infoMock = jest.spyOn(core, "info");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					        process.env["GITHUB_SERVER_URL"] = "http://github.com";
 | 
				
			||||||
 | 
					        expect(actionUtils.isCacheFeatureAvailable()).toBe(false);
 | 
				
			||||||
 | 
					        expect(infoMock).toHaveBeenCalledWith(`[warning]${message}`);
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					        delete process.env["GITHUB_SERVER_URL"];
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
				
			|||||||
@ -34,6 +34,9 @@ beforeEach(() => {
 | 
				
			|||||||
    process.env[RefKey] = "refs/heads/feature-branch";
 | 
					    process.env[RefKey] = "refs/heads/feature-branch";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false);
 | 
					    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false);
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
 | 
				
			||||||
 | 
					        () => true
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
afterEach(() => {
 | 
					afterEach(() => {
 | 
				
			||||||
@ -55,10 +58,12 @@ test("restore with invalid event outputs warning", async () => {
 | 
				
			|||||||
    expect(failedMock).toHaveBeenCalledTimes(0);
 | 
					    expect(failedMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test("restore on GHES should no-op", async () => {
 | 
					test("restore without AC available should no-op", async () => {
 | 
				
			||||||
    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
 | 
					    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false);
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
 | 
				
			||||||
 | 
					        () => false
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const logWarningMock = jest.spyOn(actionUtils, "logWarning");
 | 
					 | 
				
			||||||
    const restoreCacheMock = jest.spyOn(cache, "restoreCache");
 | 
					    const restoreCacheMock = jest.spyOn(cache, "restoreCache");
 | 
				
			||||||
    const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput");
 | 
					    const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -67,9 +72,54 @@ test("restore on GHES should no-op", async () => {
 | 
				
			|||||||
    expect(restoreCacheMock).toHaveBeenCalledTimes(0);
 | 
					    expect(restoreCacheMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
    expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
 | 
					    expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
 | 
				
			||||||
    expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
 | 
					    expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
 | 
				
			||||||
    expect(logWarningMock).toHaveBeenCalledWith(
 | 
					});
 | 
				
			||||||
        "Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
 | 
					
 | 
				
			||||||
 | 
					test("restore on GHES without AC available should no-op", async () => {
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
 | 
				
			||||||
 | 
					        () => false
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const restoreCacheMock = jest.spyOn(cache, "restoreCache");
 | 
				
			||||||
 | 
					    const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    await run();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    expect(restoreCacheMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
 | 
					    expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
 | 
				
			||||||
 | 
					    expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test("restore on GHES with AC available ", async () => {
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
 | 
				
			||||||
 | 
					    const path = "node_modules";
 | 
				
			||||||
 | 
					    const key = "node-test";
 | 
				
			||||||
 | 
					    testUtils.setInputs({
 | 
				
			||||||
 | 
					        path: path,
 | 
				
			||||||
 | 
					        key
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const infoMock = jest.spyOn(core, "info");
 | 
				
			||||||
 | 
					    const failedMock = jest.spyOn(core, "setFailed");
 | 
				
			||||||
 | 
					    const stateMock = jest.spyOn(core, "saveState");
 | 
				
			||||||
 | 
					    const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput");
 | 
				
			||||||
 | 
					    const restoreCacheMock = jest
 | 
				
			||||||
 | 
					        .spyOn(cache, "restoreCache")
 | 
				
			||||||
 | 
					        .mockImplementationOnce(() => {
 | 
				
			||||||
 | 
					            return Promise.resolve(key);
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    await run();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    expect(restoreCacheMock).toHaveBeenCalledTimes(1);
 | 
				
			||||||
 | 
					    expect(restoreCacheMock).toHaveBeenCalledWith([path], key, []);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
 | 
				
			||||||
 | 
					    expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
 | 
				
			||||||
 | 
					    expect(setCacheHitOutputMock).toHaveBeenCalledWith(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    expect(infoMock).toHaveBeenCalledWith(`Cache restored from key: ${key}`);
 | 
				
			||||||
 | 
					    expect(failedMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test("restore with no path should fail", async () => {
 | 
					test("restore with no path should fail", async () => {
 | 
				
			||||||
 | 
				
			|||||||
@ -54,6 +54,9 @@ beforeEach(() => {
 | 
				
			|||||||
    process.env[RefKey] = "refs/heads/feature-branch";
 | 
					    process.env[RefKey] = "refs/heads/feature-branch";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false);
 | 
					    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false);
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
 | 
				
			||||||
 | 
					        () => true
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
afterEach(() => {
 | 
					afterEach(() => {
 | 
				
			||||||
@ -101,18 +104,67 @@ test("save with no primary key in state outputs warning", async () => {
 | 
				
			|||||||
    expect(failedMock).toHaveBeenCalledTimes(0);
 | 
					    expect(failedMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test("save on GHES should no-op", async () => {
 | 
					test("save without AC available should no-op", async () => {
 | 
				
			||||||
    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
 | 
					    jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
 | 
				
			||||||
 | 
					        () => false
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const logWarningMock = jest.spyOn(actionUtils, "logWarning");
 | 
					 | 
				
			||||||
    const saveCacheMock = jest.spyOn(cache, "saveCache");
 | 
					    const saveCacheMock = jest.spyOn(cache, "saveCache");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    await run();
 | 
					    await run();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    expect(saveCacheMock).toHaveBeenCalledTimes(0);
 | 
					    expect(saveCacheMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
    expect(logWarningMock).toHaveBeenCalledWith(
 | 
					});
 | 
				
			||||||
        "Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
 | 
					
 | 
				
			||||||
 | 
					test("save on ghes without AC available should no-op", async () => {
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isCacheFeatureAvailable").mockImplementation(
 | 
				
			||||||
 | 
					        () => false
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const saveCacheMock = jest.spyOn(cache, "saveCache");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    await run();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    expect(saveCacheMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test("save on GHES with AC available", async () => {
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
 | 
				
			||||||
 | 
					    const failedMock = jest.spyOn(core, "setFailed");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const primaryKey = "Linux-node-bb828da54c148048dd17899ba9fda624811cfb43";
 | 
				
			||||||
 | 
					    const savedCacheKey = "Linux-node-";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    jest.spyOn(core, "getState")
 | 
				
			||||||
 | 
					        // Cache Entry State
 | 
				
			||||||
 | 
					        .mockImplementationOnce(() => {
 | 
				
			||||||
 | 
					            return savedCacheKey;
 | 
				
			||||||
 | 
					        })
 | 
				
			||||||
 | 
					        // Cache Key State
 | 
				
			||||||
 | 
					        .mockImplementationOnce(() => {
 | 
				
			||||||
 | 
					            return primaryKey;
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const inputPath = "node_modules";
 | 
				
			||||||
 | 
					    testUtils.setInput(Inputs.Path, inputPath);
 | 
				
			||||||
 | 
					    testUtils.setInput(Inputs.UploadChunkSize, "4000000");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const cacheId = 4;
 | 
				
			||||||
 | 
					    const saveCacheMock = jest
 | 
				
			||||||
 | 
					        .spyOn(cache, "saveCache")
 | 
				
			||||||
 | 
					        .mockImplementationOnce(() => {
 | 
				
			||||||
 | 
					            return Promise.resolve(cacheId);
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    await run();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    expect(saveCacheMock).toHaveBeenCalledTimes(1);
 | 
				
			||||||
 | 
					    expect(saveCacheMock).toHaveBeenCalledWith([inputPath], primaryKey, {
 | 
				
			||||||
 | 
					        uploadChunkSize: 4000000
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    expect(failedMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test("save with exact match returns early", async () => {
 | 
					test("save with exact match returns early", async () => {
 | 
				
			||||||
 | 
				
			|||||||
@ -18,7 +18,7 @@ outputs:
 | 
				
			|||||||
  cache-hit:
 | 
					  cache-hit:
 | 
				
			||||||
    description: 'A boolean value to indicate an exact match was found for the primary key'
 | 
					    description: 'A boolean value to indicate an exact match was found for the primary key'
 | 
				
			||||||
runs:
 | 
					runs:
 | 
				
			||||||
  using: 'node12'
 | 
					  using: 'node16'
 | 
				
			||||||
  main: 'dist/restore/index.js'
 | 
					  main: 'dist/restore/index.js'
 | 
				
			||||||
  post: 'dist/save/index.js'
 | 
					  post: 'dist/save/index.js'
 | 
				
			||||||
  post-if: 'success()'
 | 
					  post-if: 'success()'
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										5356
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5356
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										5360
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5360
									
								
								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)
 | 
					- [D - DUB](#d---dub)
 | 
				
			||||||
  - [POSIX](#posix)
 | 
					  - [POSIX](#posix)
 | 
				
			||||||
  - [Windows](#windows)
 | 
					  - [Windows](#windows)
 | 
				
			||||||
- [Elixir - Mix](#elixir---mix)
 | 
					- [Deno](#deno)
 | 
				
			||||||
- [Go - Modules](#go---modules)
 | 
					 | 
				
			||||||
  - [Linux](#linux)
 | 
					  - [Linux](#linux)
 | 
				
			||||||
  - [macOS](#macos)
 | 
					  - [macOS](#macos)
 | 
				
			||||||
  - [Windows](#windows-1)
 | 
					  - [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 - Cabal](#haskell---cabal)
 | 
				
			||||||
 | 
					- [Haskell - Stack](#haskell---stack)
 | 
				
			||||||
- [Java - Gradle](#java---gradle)
 | 
					- [Java - Gradle](#java---gradle)
 | 
				
			||||||
- [Java - Maven](#java---maven)
 | 
					- [Java - Maven](#java---maven)
 | 
				
			||||||
- [Node - npm](#node---npm)
 | 
					- [Node - npm](#node---npm)
 | 
				
			||||||
  - [macOS and Ubuntu](#macos-and-ubuntu)
 | 
					  - [macOS and Ubuntu](#macos-and-ubuntu)
 | 
				
			||||||
  - [Windows](#windows-2)
 | 
					  - [Windows](#windows-3)
 | 
				
			||||||
  - [Using multiple systems and `npm config`](#using-multiple-systems-and-npm-config)
 | 
					  - [Using multiple systems and `npm config`](#using-multiple-systems-and-npm-config)
 | 
				
			||||||
- [Node - Lerna](#node---lerna)
 | 
					- [Node - Lerna](#node---lerna)
 | 
				
			||||||
- [Node - Yarn](#node---yarn)
 | 
					- [Node - Yarn](#node---yarn)
 | 
				
			||||||
@ -28,8 +33,6 @@
 | 
				
			|||||||
  - [Using pip to get cache location](#using-pip-to-get-cache-location)
 | 
					  - [Using pip to get cache location](#using-pip-to-get-cache-location)
 | 
				
			||||||
- [Python - pipenv](#python---pipenv)
 | 
					- [Python - pipenv](#python---pipenv)
 | 
				
			||||||
- [R - renv](#r---renv)
 | 
					- [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)
 | 
					- [Ruby - Bundler](#ruby---bundler)
 | 
				
			||||||
- [Rust - Cargo](#rust---cargo)
 | 
					- [Rust - Cargo](#rust---cargo)
 | 
				
			||||||
- [Scala - SBT](#scala---sbt)
 | 
					- [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):
 | 
					Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~/.nuget/packages
 | 
					    path: ~/.nuget/packages
 | 
				
			||||||
    key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
 | 
					    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.
 | 
					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
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: |
 | 
					    path: |
 | 
				
			||||||
      ~/.nuget/packages
 | 
					      ~/.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.
 | 
					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
 | 
					>Note: This workflow does not work for projects that require files to be placed in user profile package folder
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
env:
 | 
					env:
 | 
				
			||||||
  NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
 | 
					  NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
 | 
				
			||||||
steps:
 | 
					steps:
 | 
				
			||||||
  - uses: actions/cache@v2
 | 
					  - uses: actions/cache@v3
 | 
				
			||||||
    with:
 | 
					    with:
 | 
				
			||||||
      path: ${{ github.workspace }}/.nuget/packages
 | 
					      path: ${{ github.workspace }}/.nuget/packages
 | 
				
			||||||
      key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
 | 
					      key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
 | 
				
			||||||
@ -83,7 +87,7 @@ steps:
 | 
				
			|||||||
### POSIX
 | 
					### POSIX
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~/.dub
 | 
					    path: ~/.dub
 | 
				
			||||||
    key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
 | 
					    key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
 | 
				
			||||||
@ -94,7 +98,7 @@ steps:
 | 
				
			|||||||
### Windows
 | 
					### Windows
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~\AppData\Local\dub
 | 
					    path: ~\AppData\Local\dub
 | 
				
			||||||
    key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
 | 
					    key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
 | 
				
			||||||
@ -102,10 +106,46 @@ steps:
 | 
				
			|||||||
      ${{ runner.os }}-dub-
 | 
					      ${{ 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
 | 
					## Elixir - Mix
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: |
 | 
					    path: |
 | 
				
			||||||
      deps
 | 
					      deps
 | 
				
			||||||
@ -120,7 +160,7 @@ steps:
 | 
				
			|||||||
### Linux
 | 
					### Linux
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: |
 | 
					    path: |
 | 
				
			||||||
      ~/.cache/go-build
 | 
					      ~/.cache/go-build
 | 
				
			||||||
@ -133,7 +173,7 @@ steps:
 | 
				
			|||||||
### macOS
 | 
					### macOS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: |
 | 
					    path: |
 | 
				
			||||||
      ~/Library/Caches/go-build
 | 
					      ~/Library/Caches/go-build
 | 
				
			||||||
@ -146,11 +186,11 @@ steps:
 | 
				
			|||||||
### Windows
 | 
					### Windows
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: |
 | 
					    path: |
 | 
				
			||||||
      %LocalAppData%\go-build
 | 
					      ~\AppData\Local\go-build
 | 
				
			||||||
      ~/go/pkg/mod
 | 
					      ~\go\pkg\mod
 | 
				
			||||||
    key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
 | 
					    key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
 | 
				
			||||||
    restore-keys: |
 | 
					    restore-keys: |
 | 
				
			||||||
      ${{ runner.os }}-go-
 | 
					      ${{ runner.os }}-go-
 | 
				
			||||||
@ -162,7 +202,7 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
 | 
					- name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
 | 
				
			||||||
  uses: actions/cache@v2
 | 
					  uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: |
 | 
					    path: |
 | 
				
			||||||
      ~/.cabal/packages
 | 
					      ~/.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 }}-
 | 
					    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
 | 
					## 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.
 | 
					>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
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: |
 | 
					    path: |
 | 
				
			||||||
      ~/.gradle/caches
 | 
					      ~/.gradle/caches
 | 
				
			||||||
@ -191,7 +250,7 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- name: Cache local Maven repository
 | 
					- name: Cache local Maven repository
 | 
				
			||||||
  uses: actions/cache@v2
 | 
					  uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~/.m2/repository
 | 
					    path: ~/.m2/repository
 | 
				
			||||||
    key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
 | 
					    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
 | 
					### macOS and Ubuntu
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~/.npm
 | 
					    path: ~/.npm
 | 
				
			||||||
    key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
 | 
					    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
 | 
					  id: npm-cache
 | 
				
			||||||
  run: |
 | 
					  run: |
 | 
				
			||||||
    echo "::set-output name=dir::$(npm config get cache)"
 | 
					    echo "::set-output name=dir::$(npm config get cache)"
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ${{ steps.npm-cache.outputs.dir }}
 | 
					    path: ${{ steps.npm-cache.outputs.dir }}
 | 
				
			||||||
    key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
 | 
					    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
 | 
					  id: npm-cache-dir
 | 
				
			||||||
  run: |
 | 
					  run: |
 | 
				
			||||||
    echo "::set-output name=dir::$(npm config get cache)"
 | 
					    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'
 | 
					  id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ${{ steps.npm-cache-dir.outputs.dir }}
 | 
					    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
 | 
					```yaml
 | 
				
			||||||
- name: restore lerna
 | 
					- name: restore lerna
 | 
				
			||||||
  uses: actions/cache@v2
 | 
					  uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: |
 | 
					    path: **/node_modules
 | 
				
			||||||
      node_modules
 | 
					 | 
				
			||||||
      */*/node_modules
 | 
					 | 
				
			||||||
    key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
 | 
					    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
 | 
					  id: yarn-cache-dir-path
 | 
				
			||||||
  run: echo "::set-output name=dir::$(yarn cache dir)"
 | 
					  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'`)
 | 
					  id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
 | 
					    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
 | 
					  id: yarn-cache-dir-path
 | 
				
			||||||
  run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
 | 
					  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'`)
 | 
					  id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
 | 
					    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
 | 
					```yaml
 | 
				
			||||||
    - name: Restore Cache
 | 
					    - name: Restore Cache
 | 
				
			||||||
      id: restore-cache
 | 
					      id: restore-cache
 | 
				
			||||||
      uses: actions/cache@v2
 | 
					      uses: actions/cache@v3
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
        path: _export
 | 
					        path: _export
 | 
				
			||||||
        key:  ${{ runner.os }}-esy-${{ hashFiles('esy.lock/index.json') }}
 | 
					        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
 | 
					  id: composer-cache
 | 
				
			||||||
  run: |
 | 
					  run: |
 | 
				
			||||||
    echo "::set-output name=dir::$(composer config cache-files-dir)"
 | 
					    echo "::set-output name=dir::$(composer config cache-files-dir)"
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ${{ steps.composer-cache.outputs.dir }}
 | 
					    path: ${{ steps.composer-cache.outputs.dir }}
 | 
				
			||||||
    key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
 | 
					    key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
 | 
				
			||||||
@ -352,7 +409,7 @@ Locations:
 | 
				
			|||||||
### Simple example
 | 
					### Simple example
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~/.cache/pip
 | 
					    path: ~/.cache/pip
 | 
				
			||||||
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
					    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
 | 
					### Multiple OS's in a workflow
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  if: startsWith(runner.os, 'Linux')
 | 
					  if: startsWith(runner.os, 'Linux')
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~/.cache/pip
 | 
					    path: ~/.cache/pip
 | 
				
			||||||
@ -373,7 +430,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
 | 
				
			|||||||
    restore-keys: |
 | 
					    restore-keys: |
 | 
				
			||||||
      ${{ runner.os }}-pip-
 | 
					      ${{ runner.os }}-pip-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  if: startsWith(runner.os, 'macOS')
 | 
					  if: startsWith(runner.os, 'macOS')
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~/Library/Caches/pip
 | 
					    path: ~/Library/Caches/pip
 | 
				
			||||||
@ -381,7 +438,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
 | 
				
			|||||||
    restore-keys: |
 | 
					    restore-keys: |
 | 
				
			||||||
      ${{ runner.os }}-pip-
 | 
					      ${{ runner.os }}-pip-
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  if: startsWith(runner.os, 'Windows')
 | 
					  if: startsWith(runner.os, 'Windows')
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~\AppData\Local\pip\Cache
 | 
					    path: ~\AppData\Local\pip\Cache
 | 
				
			||||||
@ -407,7 +464,7 @@ jobs:
 | 
				
			|||||||
        - os: windows-latest
 | 
					        - os: windows-latest
 | 
				
			||||||
          path: ~\AppData\Local\pip\Cache
 | 
					          path: ~\AppData\Local\pip\Cache
 | 
				
			||||||
    steps:
 | 
					    steps:
 | 
				
			||||||
    - uses: actions/cache@v2
 | 
					    - uses: actions/cache@v3
 | 
				
			||||||
      with:
 | 
					      with:
 | 
				
			||||||
        path: ${{ matrix.path }}
 | 
					        path: ${{ matrix.path }}
 | 
				
			||||||
        key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
					        key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
				
			||||||
@ -425,7 +482,7 @@ jobs:
 | 
				
			|||||||
    echo "::set-output name=dir::$(pip cache dir)"
 | 
					    echo "::set-output name=dir::$(pip cache dir)"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- name: pip cache
 | 
					- name: pip cache
 | 
				
			||||||
  uses: actions/cache@v2
 | 
					  uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ${{ steps.pip-cache.outputs.dir }}
 | 
					    path: ${{ steps.pip-cache.outputs.dir }}
 | 
				
			||||||
    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
					    key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
 | 
				
			||||||
@ -443,7 +500,7 @@ jobs:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  ⋮
 | 
					  ⋮
 | 
				
			||||||
 | 
					
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ~/.local/share/virtualenvs
 | 
					    path: ~/.local/share/virtualenvs
 | 
				
			||||||
    key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}
 | 
					    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 = "")
 | 
					    cat("##[set-output name=r-version;]", R.Version()$version.string, sep = "")
 | 
				
			||||||
  shell: Rscript {0}
 | 
					  shell: Rscript {0}
 | 
				
			||||||
- name: Restore Renv package cache
 | 
					- name: Restore Renv package cache
 | 
				
			||||||
  uses: actions/cache@v2
 | 
					  uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: ${{ env.RENV_PATHS_ROOT }}
 | 
					    path: ${{ env.RENV_PATHS_ROOT }}
 | 
				
			||||||
    key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{ inputs.cache-version }}-${{ hashFiles('renv.lock') }}
 | 
					    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
 | 
					## Rust - Cargo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: |
 | 
					    path: |
 | 
				
			||||||
      ~/.cargo/bin/
 | 
					      ~/.cargo/bin/
 | 
				
			||||||
@ -511,7 +568,7 @@ whenever possible:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- name: Cache SBT
 | 
					- name: Cache SBT
 | 
				
			||||||
  uses: actions/cache@v2
 | 
					  uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: |
 | 
					    path: |
 | 
				
			||||||
      ~/.ivy2/cache
 | 
					      ~/.ivy2/cache
 | 
				
			||||||
@ -522,7 +579,7 @@ whenever possible:
 | 
				
			|||||||
## Swift, Objective-C - Carthage
 | 
					## Swift, Objective-C - Carthage
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: Carthage
 | 
					    path: Carthage
 | 
				
			||||||
    key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
 | 
					    key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
 | 
				
			||||||
@ -533,7 +590,7 @@ whenever possible:
 | 
				
			|||||||
## Swift, Objective-C - CocoaPods
 | 
					## Swift, Objective-C - CocoaPods
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: Pods
 | 
					    path: Pods
 | 
				
			||||||
    key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
 | 
					    key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
 | 
				
			||||||
@ -544,7 +601,7 @@ whenever possible:
 | 
				
			|||||||
## Swift - Swift Package Manager
 | 
					## Swift - Swift Package Manager
 | 
				
			||||||
 | 
					
 | 
				
			||||||
```yaml
 | 
					```yaml
 | 
				
			||||||
- uses: actions/cache@v2
 | 
					- uses: actions/cache@v3
 | 
				
			||||||
  with:
 | 
					  with:
 | 
				
			||||||
    path: .build
 | 
					    path: .build
 | 
				
			||||||
    key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
 | 
					    key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										17103
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										17103
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										38
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										38
									
								
								package.json
									
									
									
									
									
								
							@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "cache",
 | 
					  "name": "cache",
 | 
				
			||||||
  "version": "2.1.7",
 | 
					  "version": "3.0.2",
 | 
				
			||||||
  "private": true,
 | 
					  "private": true,
 | 
				
			||||||
  "description": "Cache dependencies and build outputs",
 | 
					  "description": "Cache dependencies and build outputs",
 | 
				
			||||||
  "main": "dist/restore/index.js",
 | 
					  "main": "dist/restore/index.js",
 | 
				
			||||||
@ -23,29 +23,29 @@
 | 
				
			|||||||
  "author": "GitHub",
 | 
					  "author": "GitHub",
 | 
				
			||||||
  "license": "MIT",
 | 
					  "license": "MIT",
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "@actions/cache": "^1.0.8",
 | 
					    "@actions/cache": "^2.0.2",
 | 
				
			||||||
    "@actions/core": "^1.2.6",
 | 
					    "@actions/core": "^1.7.0",
 | 
				
			||||||
    "@actions/exec": "^1.0.1",
 | 
					    "@actions/exec": "^1.1.1",
 | 
				
			||||||
    "@actions/io": "^1.1.0"
 | 
					    "@actions/io": "^1.1.2"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
    "@types/jest": "^27.4.0",
 | 
					    "@types/jest": "^27.5.0",
 | 
				
			||||||
    "@types/nock": "^11.1.0",
 | 
					    "@types/nock": "^11.1.0",
 | 
				
			||||||
    "@types/node": "^12.20.42",
 | 
					    "@types/node": "^16.11.33",
 | 
				
			||||||
    "@typescript-eslint/eslint-plugin": "^5.10.1",
 | 
					    "@typescript-eslint/eslint-plugin": "^5.22.0",
 | 
				
			||||||
    "@typescript-eslint/parser": "^5.10.1",
 | 
					    "@typescript-eslint/parser": "^5.22.0",
 | 
				
			||||||
    "@zeit/ncc": "^0.20.5",
 | 
					    "@zeit/ncc": "^0.20.5",
 | 
				
			||||||
    "eslint": "^8.8.0",
 | 
					    "eslint": "^8.14.0",
 | 
				
			||||||
    "eslint-config-prettier": "^8.3.0",
 | 
					    "eslint-config-prettier": "^8.5.0",
 | 
				
			||||||
    "eslint-plugin-import": "^2.25.4",
 | 
					    "eslint-plugin-import": "^2.26.0",
 | 
				
			||||||
    "eslint-plugin-jest": "^26.0.0",
 | 
					    "eslint-plugin-jest": "^26.1.5",
 | 
				
			||||||
    "eslint-plugin-prettier": "^4.0.0",
 | 
					    "eslint-plugin-prettier": "^4.0.0",
 | 
				
			||||||
    "eslint-plugin-simple-import-sort": "^7.0.0",
 | 
					    "eslint-plugin-simple-import-sort": "^7.0.0",
 | 
				
			||||||
    "jest": "^27.4.7",
 | 
					    "jest": "^28.0.3",
 | 
				
			||||||
    "jest-circus": "^27.4.6",
 | 
					    "jest-circus": "^27.5.1",
 | 
				
			||||||
    "nock": "^11.7.0",
 | 
					    "nock": "^13.2.4",
 | 
				
			||||||
    "prettier": "^2.5.1",
 | 
					    "prettier": "^2.6.2",
 | 
				
			||||||
    "ts-jest": "^27.1.3",
 | 
					    "ts-jest": "^28.0.2",
 | 
				
			||||||
    "typescript": "^3.9.9"
 | 
					    "typescript": "^4.6.4"
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -6,10 +6,7 @@ import * as utils from "./utils/actionUtils";
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
async function run(): Promise<void> {
 | 
					async function run(): Promise<void> {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        if (utils.isGhes()) {
 | 
					        if (!utils.isCacheFeatureAvailable()) {
 | 
				
			||||||
            utils.logWarning(
 | 
					 | 
				
			||||||
                "Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
 | 
					 | 
				
			||||||
            );
 | 
					 | 
				
			||||||
            utils.setCacheHitOutput(false);
 | 
					            utils.setCacheHitOutput(false);
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
@ -55,16 +52,17 @@ async function run(): Promise<void> {
 | 
				
			|||||||
            utils.setCacheHitOutput(isExactKeyMatch);
 | 
					            utils.setCacheHitOutput(isExactKeyMatch);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            core.info(`Cache restored from key: ${cacheKey}`);
 | 
					            core.info(`Cache restored from key: ${cacheKey}`);
 | 
				
			||||||
        } catch (error) {
 | 
					        } catch (error: unknown) {
 | 
				
			||||||
            if (error.name === cache.ValidationError.name) {
 | 
					            const typedError = error as Error;
 | 
				
			||||||
 | 
					            if (typedError.name === cache.ValidationError.name) {
 | 
				
			||||||
                throw error;
 | 
					                throw error;
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                utils.logWarning(error.message);
 | 
					                utils.logWarning(typedError.message);
 | 
				
			||||||
                utils.setCacheHitOutput(false);
 | 
					                utils.setCacheHitOutput(false);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    } catch (error) {
 | 
					    } catch (error: unknown) {
 | 
				
			||||||
        core.setFailed(error.message);
 | 
					        core.setFailed((error as Error).message);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										20
									
								
								src/save.ts
									
									
									
									
									
								
							
							
						
						
									
										20
									
								
								src/save.ts
									
									
									
									
									
								
							@ -11,10 +11,7 @@ process.on("uncaughtException", e => utils.logWarning(e.message));
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
async function run(): Promise<void> {
 | 
					async function run(): Promise<void> {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
        if (utils.isGhes()) {
 | 
					        if (!utils.isCacheFeatureAvailable()) {
 | 
				
			||||||
            utils.logWarning(
 | 
					 | 
				
			||||||
                "Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
 | 
					 | 
				
			||||||
            );
 | 
					 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -52,17 +49,18 @@ async function run(): Promise<void> {
 | 
				
			|||||||
                uploadChunkSize: utils.getInputAsInt(Inputs.UploadChunkSize)
 | 
					                uploadChunkSize: utils.getInputAsInt(Inputs.UploadChunkSize)
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
            core.info(`Cache saved with key: ${primaryKey}`);
 | 
					            core.info(`Cache saved with key: ${primaryKey}`);
 | 
				
			||||||
        } catch (error) {
 | 
					        } catch (error: unknown) {
 | 
				
			||||||
            if (error.name === cache.ValidationError.name) {
 | 
					            const typedError = error as Error;
 | 
				
			||||||
 | 
					            if (typedError.name === cache.ValidationError.name) {
 | 
				
			||||||
                throw error;
 | 
					                throw error;
 | 
				
			||||||
            } else if (error.name === cache.ReserveCacheError.name) {
 | 
					            } else if (typedError.name === cache.ReserveCacheError.name) {
 | 
				
			||||||
                core.info(error.message);
 | 
					                core.info(typedError.message);
 | 
				
			||||||
            } else {
 | 
					            } else {
 | 
				
			||||||
                utils.logWarning(error.message);
 | 
					                utils.logWarning(typedError.message);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    } catch (error) {
 | 
					    } catch (error: unknown) {
 | 
				
			||||||
        utils.logWarning(error.message);
 | 
					        utils.logWarning((error as Error).message);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -1,3 +1,4 @@
 | 
				
			|||||||
 | 
					import * as cache from "@actions/cache";
 | 
				
			||||||
import * as core from "@actions/core";
 | 
					import * as core from "@actions/core";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import { Outputs, RefKey, State } from "../constants";
 | 
					import { Outputs, RefKey, State } from "../constants";
 | 
				
			||||||
@ -74,3 +75,20 @@ export function getInputAsInt(
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
    return value;
 | 
					    return value;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export function isCacheFeatureAvailable(): boolean {
 | 
				
			||||||
 | 
					    if (!cache.isFeatureAvailable()) {
 | 
				
			||||||
 | 
					        if (isGhes()) {
 | 
				
			||||||
 | 
					            logWarning(
 | 
				
			||||||
 | 
					                "Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not."
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
 | 
					            logWarning(
 | 
				
			||||||
 | 
					                "An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions."
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        return false;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return true;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user