Compare commits
	
		
			18 Commits
		
	
	
		
			dhadka/upd
			...
			anuragc617
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2b250bc32a | |||
| 8492260343 | |||
| 937d244753 | |||
| eb0698d1c5 | |||
| 67b6d52d50 | |||
| 92f67a4829 | |||
| 6bbe742add | |||
| c9db520cf3 | |||
| 10906ba9cd | |||
| 2ebdcff279 | |||
| 5807af2642 | |||
| 0638051e9a | |||
| c64c572235 | |||
| cc2d767a72 | |||
| 2fa955d825 | |||
| 3a696372f2 | |||
| 366e5ba022 | |||
| 8d3f2fc3ce | 
							
								
								
									
										52
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										52
									
								
								.github/workflows/check-dist.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@ -0,0 +1,52 @@
 | 
			
		||||
# `dist/index.js` is a special file in Actions.
 | 
			
		||||
# When you reference an action with `uses:` in a workflow,
 | 
			
		||||
# `index.js` is the code that will run.
 | 
			
		||||
# For our project, we generate this file through a build process
 | 
			
		||||
# from other source files.
 | 
			
		||||
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
 | 
			
		||||
name: Check dist/
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  push:
 | 
			
		||||
    branches:
 | 
			
		||||
      - main
 | 
			
		||||
    paths-ignore:
 | 
			
		||||
      - '**.md'
 | 
			
		||||
  pull_request:
 | 
			
		||||
    paths-ignore:
 | 
			
		||||
      - '**.md'
 | 
			
		||||
  workflow_dispatch:
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  check-dist:
 | 
			
		||||
    runs-on: ubuntu-latest
 | 
			
		||||
 | 
			
		||||
    steps:
 | 
			
		||||
      - uses: actions/checkout@v2
 | 
			
		||||
 | 
			
		||||
      - name: Set Node.js 12.x
 | 
			
		||||
        uses: actions/setup-node@v1
 | 
			
		||||
        with:
 | 
			
		||||
          node-version: 12.x
 | 
			
		||||
 | 
			
		||||
      - name: Install dependencies
 | 
			
		||||
        run: npm ci
 | 
			
		||||
 | 
			
		||||
      - name: Rebuild the dist/ directory
 | 
			
		||||
        run: npm run build
 | 
			
		||||
 | 
			
		||||
      - name: Compare the expected and actual dist/ directories
 | 
			
		||||
        run: |
 | 
			
		||||
          if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
 | 
			
		||||
            echo "Detected uncommitted changes after build.  See status below:"
 | 
			
		||||
            git diff
 | 
			
		||||
            exit 1
 | 
			
		||||
          fi
 | 
			
		||||
        id: diff
 | 
			
		||||
 | 
			
		||||
      # If index.js was different than expected, upload the expected version as an artifact
 | 
			
		||||
      - uses: actions/upload-artifact@v2
 | 
			
		||||
        if: ${{ failure() && steps.diff.conclusion == 'failure' }}
 | 
			
		||||
        with:
 | 
			
		||||
          name: dist
 | 
			
		||||
          path: dist/
 | 
			
		||||
							
								
								
									
										10
									
								
								.github/workflows/licensed.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								.github/workflows/licensed.yml
									
									
									
									
										vendored
									
									
								
							@ -1,8 +1,12 @@
 | 
			
		||||
name: Licensed
 | 
			
		||||
 | 
			
		||||
on:
 | 
			
		||||
  push: {branches: main}
 | 
			
		||||
  pull_request: {branches: main}
 | 
			
		||||
  push:
 | 
			
		||||
    branches:
 | 
			
		||||
      - main
 | 
			
		||||
  pull_request:
 | 
			
		||||
    branches:
 | 
			
		||||
      - main
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  test:
 | 
			
		||||
@ -17,4 +21,4 @@ jobs:
 | 
			
		||||
          curl -Lfs -o licensed.tar.gz https://github.com/github/licensed/releases/download/2.12.2/licensed-2.12.2-linux-x64.tar.gz
 | 
			
		||||
          sudo tar -xzf licensed.tar.gz
 | 
			
		||||
          sudo mv licensed /usr/local/bin/licensed
 | 
			
		||||
      - run: licensed status
 | 
			
		||||
      - run: licensed status
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										17
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										17
									
								
								.github/workflows/workflow.yml
									
									
									
									
										vendored
									
									
								
							@ -19,7 +19,7 @@ jobs:
 | 
			
		||||
  build:
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        os: [ubuntu-latest, ubuntu-16.04, windows-latest, macOS-latest]
 | 
			
		||||
        os: [ubuntu-latest, windows-latest, macOS-latest]
 | 
			
		||||
      fail-fast: false
 | 
			
		||||
    runs-on: ${{ matrix.os }}
 | 
			
		||||
    steps:
 | 
			
		||||
@ -47,23 +47,12 @@ jobs:
 | 
			
		||||
      run: npm run lint
 | 
			
		||||
    - name: Build & Test
 | 
			
		||||
      run: npm run test
 | 
			
		||||
    - name: Ensure dist/ folder is up-to-date
 | 
			
		||||
      if: ${{ runner.os == 'Linux' }}
 | 
			
		||||
      shell: bash
 | 
			
		||||
      run: |
 | 
			
		||||
        npm run build
 | 
			
		||||
        if [ "$(git diff --ignore-space-at-eol | wc -l)" -gt "0" ]; then
 | 
			
		||||
          echo "Detected uncommitted changes after build.  See status below:"
 | 
			
		||||
          git diff
 | 
			
		||||
          exit 1
 | 
			
		||||
        fi
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
  # End to end save and restore
 | 
			
		||||
  test-save:
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        os: [ubuntu-latest, ubuntu-16.04, windows-latest, macOS-latest]
 | 
			
		||||
        os: [ubuntu-latest, windows-latest, macOS-latest]
 | 
			
		||||
      fail-fast: false
 | 
			
		||||
    runs-on: ${{ matrix.os }}
 | 
			
		||||
    steps:
 | 
			
		||||
@ -86,7 +75,7 @@ jobs:
 | 
			
		||||
    needs: test-save
 | 
			
		||||
    strategy:
 | 
			
		||||
      matrix:
 | 
			
		||||
        os: [ubuntu-latest, ubuntu-16.04, windows-latest, macOS-latest]
 | 
			
		||||
        os: [ubuntu-latest, windows-latest, macOS-latest]
 | 
			
		||||
      fail-fast: false
 | 
			
		||||
    runs-on: ${{ matrix.os }}
 | 
			
		||||
    steps:
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/cache.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/core.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/core.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/exec.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/exec.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/glob.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/glob.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@actions/io.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@actions/io.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-auth.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-auth.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-http.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-http.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-lro.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-lro.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-paging.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/core-paging.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/logger.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/logger.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/ms-rest-js.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/ms-rest-js.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@azure/storage-blob.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@azure/storage-blob.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@opencensus/web-types.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@opencensus/web-types.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@opentelemetry/api-0.10.2.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@opentelemetry/api-0.10.2.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@opentelemetry/context-base.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@opentelemetry/context-base.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@types/node-fetch.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@types/node-fetch.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@types/node.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@types/node.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/@types/tunnel.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/@types/tunnel.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/balanced-match.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/balanced-match.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/form-data-4.0.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/form-data-4.0.0.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/mime-db.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/mime-db.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/mime-types.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/mime-types.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/node-fetch.dep.yml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/node-fetch.dep.yml
									
									
									
										generated
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/webidl-conversions.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/webidl-conversions.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								.licenses/npm/whatwg-url.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								.licenses/npm/whatwg-url.dep.yml
									
									
									
										generated
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							@ -68,7 +68,7 @@ test("restore on GHES should no-op", async () => {
 | 
			
		||||
    expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
 | 
			
		||||
    expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
 | 
			
		||||
    expect(logWarningMock).toHaveBeenCalledWith(
 | 
			
		||||
        "Cache action is not supported on GHES"
 | 
			
		||||
        "Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
 | 
			
		||||
    );
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -111,7 +111,7 @@ test("save on GHES should no-op", async () => {
 | 
			
		||||
 | 
			
		||||
    expect(saveCacheMock).toHaveBeenCalledTimes(0);
 | 
			
		||||
    expect(logWarningMock).toHaveBeenCalledWith(
 | 
			
		||||
        "Cache action is not supported on GHES"
 | 
			
		||||
        "Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
 | 
			
		||||
    );
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										46738
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										46738
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										46742
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										46742
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										207
									
								
								examples.md
									
									
									
									
									
								
							
							
						
						
									
										207
									
								
								examples.md
									
									
									
									
									
								
							@ -1,39 +1,44 @@
 | 
			
		||||
# Examples
 | 
			
		||||
 | 
			
		||||
- [Examples](#examples)
 | 
			
		||||
  - [C# - NuGet](#c---nuget)
 | 
			
		||||
  - [D - DUB](#d---dub)
 | 
			
		||||
  - [Elixir - Mix](#elixir---mix)
 | 
			
		||||
  - [Go - Modules](#go---modules)
 | 
			
		||||
  - [Haskell - Cabal](#haskell---cabal)
 | 
			
		||||
  - [Java - Gradle](#java---gradle)
 | 
			
		||||
  - [Java - Maven](#java---maven)
 | 
			
		||||
  - [Node - npm](#node---npm)
 | 
			
		||||
    - [macOS and Ubuntu](#macos-and-ubuntu)
 | 
			
		||||
    - [Windows](#windows)
 | 
			
		||||
    - [Using multiple systems and `npm config`](#using-multiple-systems-and-npm-config)
 | 
			
		||||
  - [Node - Lerna](#node---lerna)
 | 
			
		||||
  - [Node - Yarn](#node---yarn)
 | 
			
		||||
  - [Node - Yarn 2](#node---yarn-2)
 | 
			
		||||
  - [OCaml/Reason - esy](#ocamlreason---esy)
 | 
			
		||||
  - [PHP - Composer](#php---composer)
 | 
			
		||||
  - [Python - pip](#python---pip)
 | 
			
		||||
    - [Simple example](#simple-example)
 | 
			
		||||
    - [Multiple OSes in a workflow](#multiple-oss-in-a-workflow)
 | 
			
		||||
    - [Using pip to get cache location](#using-pip-to-get-cache-location)
 | 
			
		||||
    - [Using a script to get cache location](#using-a-script-to-get-cache-location)
 | 
			
		||||
  - [Python - pipenv](#python---pipenv)
 | 
			
		||||
  - [R - renv](#r---renv)
 | 
			
		||||
    - [Simple example](#simple-example-1)
 | 
			
		||||
    - [Multiple OSes in a workflow](#multiple-oss-in-a-workflow-1)
 | 
			
		||||
  - [Ruby - Bundler](#ruby---bundler)
 | 
			
		||||
  - [Rust - Cargo](#rust---cargo)
 | 
			
		||||
  - [Scala - SBT](#scala---sbt)
 | 
			
		||||
  - [Swift, Objective-C - Carthage](#swift-objective-c---carthage)
 | 
			
		||||
  - [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods)
 | 
			
		||||
  - [Swift - Swift Package Manager](#swift---swift-package-manager)
 | 
			
		||||
- [C# - NuGet](#c---nuget)
 | 
			
		||||
- [D - DUB](#d---dub)
 | 
			
		||||
  - [POSIX](#posix)
 | 
			
		||||
  - [Windows](#windows)
 | 
			
		||||
- [Elixir - Mix](#elixir---mix)
 | 
			
		||||
- [Go - Modules](#go---modules)
 | 
			
		||||
  - [Linux](#linux)
 | 
			
		||||
  - [macOS](#macos)
 | 
			
		||||
  - [Windows](#windows-1)
 | 
			
		||||
- [Haskell - Cabal](#haskell---cabal)
 | 
			
		||||
- [Java - Gradle](#java---gradle)
 | 
			
		||||
- [Java - Maven](#java---maven)
 | 
			
		||||
- [Node - npm](#node---npm)
 | 
			
		||||
  - [macOS and Ubuntu](#macos-and-ubuntu)
 | 
			
		||||
  - [Windows](#windows-2)
 | 
			
		||||
  - [Using multiple systems and `npm config`](#using-multiple-systems-and-npm-config)
 | 
			
		||||
- [Node - Lerna](#node---lerna)
 | 
			
		||||
- [Node - Yarn](#node---yarn)
 | 
			
		||||
- [Node - Yarn 2](#node---yarn-2)
 | 
			
		||||
- [OCaml/Reason - esy](#ocamlreason---esy)
 | 
			
		||||
- [PHP - Composer](#php---composer)
 | 
			
		||||
- [Python - pip](#python---pip)
 | 
			
		||||
  - [Simple example](#simple-example)
 | 
			
		||||
  - [Multiple OS's in a workflow](#multiple-oss-in-a-workflow)
 | 
			
		||||
  - [Multiple OS's in a workflow with a matrix](#multiple-oss-in-a-workflow-with-a-matrix)
 | 
			
		||||
  - [Using pip to get cache location](#using-pip-to-get-cache-location)
 | 
			
		||||
- [Python - pipenv](#python---pipenv)
 | 
			
		||||
- [R - renv](#r---renv)
 | 
			
		||||
  - [Simple example](#simple-example-1)
 | 
			
		||||
  - [Multiple OS's in a workflow](#multiple-oss-in-a-workflow-1)
 | 
			
		||||
- [Ruby - Bundler](#ruby---bundler)
 | 
			
		||||
- [Rust - Cargo](#rust---cargo)
 | 
			
		||||
- [Scala - SBT](#scala---sbt)
 | 
			
		||||
- [Swift, Objective-C - Carthage](#swift-objective-c---carthage)
 | 
			
		||||
- [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods)
 | 
			
		||||
- [Swift - Swift Package Manager](#swift---swift-package-manager)
 | 
			
		||||
 | 
			
		||||
## C# - NuGet
 | 
			
		||||
 | 
			
		||||
Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
@ -47,10 +52,11 @@ Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/packa
 | 
			
		||||
 | 
			
		||||
Depending on the environment, huge packages might be pre-installed in the global cache folder.
 | 
			
		||||
With `actions/cache@v2` you can now exclude unwanted packages with [exclude pattern](https://github.com/actions/toolkit/tree/main/packages/glob#exclude-patterns)
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  with:
 | 
			
		||||
    path: | 
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/.nuget/packages
 | 
			
		||||
      !~/.nuget/packages/unwanted
 | 
			
		||||
    key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
 | 
			
		||||
@ -97,23 +103,54 @@ steps:
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Elixir - Mix
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      deps
 | 
			
		||||
      _build
 | 
			
		||||
    key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
 | 
			
		||||
    key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-mix-
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Go - Modules
 | 
			
		||||
 | 
			
		||||
### Linux
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/go/pkg/mod
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/.cache/go-build
 | 
			
		||||
      ~/go/pkg/mod
 | 
			
		||||
    key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-go-
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### macOS
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/Library/Caches/go-build
 | 
			
		||||
      ~/go/pkg/mod
 | 
			
		||||
    key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-go-
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Windows
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      %LocalAppData%\go-build
 | 
			
		||||
      ~/go/pkg/mod
 | 
			
		||||
    key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-go-
 | 
			
		||||
@ -136,6 +173,8 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
 | 
			
		||||
 | 
			
		||||
## Java - Gradle
 | 
			
		||||
 | 
			
		||||
>Note: Ensure no Gradle daemons are running anymore when your workflow completes. Creating the cache package might fail due to locks being held by Gradle. Refer to the [Gradle Daemon documentation](https://docs.gradle.org/current/userguide/gradle_daemon.html) on how to disable or stop the Gradle Daemons.
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  with:
 | 
			
		||||
@ -238,8 +277,8 @@ The yarn cache directory will depend on your operating system and version of `ya
 | 
			
		||||
      ${{ runner.os }}-yarn-
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## Node - Yarn 2
 | 
			
		||||
 | 
			
		||||
The yarn 2 cache directory will depend on your config. See https://yarnpkg.com/configuration/yarnrc#cacheFolder for more info.
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
@ -257,6 +296,7 @@ The yarn 2 cache directory will depend on your config. See https://yarnpkg.com/c
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## OCaml/Reason - esy
 | 
			
		||||
 | 
			
		||||
Esy allows you to export built dependencies and import pre-built dependencies.
 | 
			
		||||
```yaml
 | 
			
		||||
    - name: Restore Cache
 | 
			
		||||
@ -277,13 +317,12 @@ Esy allows you to export built dependencies and import pre-built dependencies.
 | 
			
		||||
    ...(Build job)...
 | 
			
		||||
 | 
			
		||||
    # Re-export dependencies if anything has changed or if it is the first time
 | 
			
		||||
    - name: Setting dependency cache 
 | 
			
		||||
    - name: Setting dependency cache
 | 
			
		||||
      run: |
 | 
			
		||||
        esy export-dependencies
 | 
			
		||||
      if: steps.restore-cache.outputs.cache-hit != 'true'
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## PHP - Composer
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
@ -304,11 +343,13 @@ Esy allows you to export built dependencies and import pre-built dependencies.
 | 
			
		||||
For pip, the cache directory will vary by OS. See https://pip.pypa.io/en/stable/reference/pip_install/#caching
 | 
			
		||||
 | 
			
		||||
Locations:
 | 
			
		||||
 - Ubuntu: `~/.cache/pip`
 | 
			
		||||
 - Windows: `~\AppData\Local\pip\Cache`
 | 
			
		||||
 - macOS: `~/Library/Caches/pip`
 | 
			
		||||
 | 
			
		||||
- Ubuntu: `~/.cache/pip`
 | 
			
		||||
- Windows: `~\AppData\Local\pip\Cache`
 | 
			
		||||
- macOS: `~/Library/Caches/pip`
 | 
			
		||||
 | 
			
		||||
### Simple example
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  with:
 | 
			
		||||
@ -394,61 +435,45 @@ jobs:
 | 
			
		||||
## Python - pipenv
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- name: Set up Python
 | 
			
		||||
  # The actions/cache step below uses this id to get the exact python version
 | 
			
		||||
  id: setup-python
 | 
			
		||||
  uses: actions/setup-python@v2
 | 
			
		||||
 | 
			
		||||
  ⋮
 | 
			
		||||
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/.local/share/virtualenvs
 | 
			
		||||
    key: ${{ runner.os }}-pipenv-${{ hashFiles('Pipfile.lock') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-pipenv-
 | 
			
		||||
    key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## R - renv
 | 
			
		||||
 | 
			
		||||
For renv, the cache directory will vary by OS. Look at https://rstudio.github.io/renv/articles/renv.html#cache
 | 
			
		||||
 | 
			
		||||
Locations:
 | 
			
		||||
 - Ubuntu: `~/.local/share/renv`
 | 
			
		||||
 - macOS: `~/Library/Application Support/renv`
 | 
			
		||||
 - Windows: `%LOCALAPPDATA%/renv`
 | 
			
		||||
 | 
			
		||||
### Simple example
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/.local/share/renv
 | 
			
		||||
    key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-renv-
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
Replace `~/.local/share/renv` with the correct `path` if not using Ubuntu.
 | 
			
		||||
 | 
			
		||||
### Multiple OS's in a workflow
 | 
			
		||||
For renv, the cache directory will vary by OS. The `RENV_PATHS_ROOT` environment variable is used to set the cache location. Have a look at https://rstudio.github.io/renv/reference/paths.html#details for more details.
 | 
			
		||||
 | 
			
		||||
```yaml
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  if: startsWith(runner.os, 'Linux')
 | 
			
		||||
- name: Set RENV_PATHS_ROOT
 | 
			
		||||
  shell: bash
 | 
			
		||||
  run: |
 | 
			
		||||
    echo "RENV_PATHS_ROOT=${{ runner.temp }}/renv" >> $GITHUB_ENV
 | 
			
		||||
- name: Install and activate renv
 | 
			
		||||
  run: |
 | 
			
		||||
    install.packages("renv")
 | 
			
		||||
    renv::activate()
 | 
			
		||||
  shell: Rscript {0}
 | 
			
		||||
- name: Get R and OS version
 | 
			
		||||
  id: get-version
 | 
			
		||||
  run: |
 | 
			
		||||
    cat("##[set-output name=os-version;]", sessionInfo()$running, "\n", sep = "")
 | 
			
		||||
    cat("##[set-output name=r-version;]", R.Version()$version.string, sep = "")
 | 
			
		||||
  shell: Rscript {0}
 | 
			
		||||
- name: Restore Renv package cache
 | 
			
		||||
  uses: actions/cache@v2
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/.local/share/renv
 | 
			
		||||
    key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-renv-
 | 
			
		||||
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  if: startsWith(runner.os, 'macOS')
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~/Library/Application Support/renv
 | 
			
		||||
    key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-renv-
 | 
			
		||||
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  if: startsWith(runner.os, 'Windows')
 | 
			
		||||
  with:
 | 
			
		||||
    path: ~\AppData\Local\renv
 | 
			
		||||
    key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
 | 
			
		||||
    restore-keys: |
 | 
			
		||||
      ${{ runner.os }}-renv-
 | 
			
		||||
    path: ${{ env.RENV_PATHS_ROOT }}
 | 
			
		||||
    key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{ inputs.cache-version }}-${{ hashFiles('renv.lock') }}
 | 
			
		||||
    restore-keys: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Ruby - Bundler
 | 
			
		||||
@ -473,9 +498,11 @@ whenever possible:
 | 
			
		||||
- uses: actions/cache@v2
 | 
			
		||||
  with:
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/.cargo/registry
 | 
			
		||||
      ~/.cargo/git
 | 
			
		||||
      target
 | 
			
		||||
      ~/.cargo/bin/
 | 
			
		||||
      ~/.cargo/registry/index/
 | 
			
		||||
      ~/.cargo/registry/cache/
 | 
			
		||||
      ~/.cargo/git/db/
 | 
			
		||||
      target/
 | 
			
		||||
    key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
@ -485,7 +512,7 @@ whenever possible:
 | 
			
		||||
- name: Cache SBT
 | 
			
		||||
  uses: actions/cache@v2
 | 
			
		||||
  with:
 | 
			
		||||
    path: | 
 | 
			
		||||
    path: |
 | 
			
		||||
      ~/.ivy2/cache
 | 
			
		||||
      ~/.sbt
 | 
			
		||||
    key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2847
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2847
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										22
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										22
									
								
								package.json
									
									
									
									
									
								
							@ -1,6 +1,6 @@
 | 
			
		||||
{
 | 
			
		||||
  "name": "cache",
 | 
			
		||||
  "version": "2.1.5",
 | 
			
		||||
  "version": "2.1.8",
 | 
			
		||||
  "private": true,
 | 
			
		||||
  "description": "Cache dependencies and build outputs",
 | 
			
		||||
  "main": "dist/restore/index.js",
 | 
			
		||||
@ -23,29 +23,29 @@
 | 
			
		||||
  "author": "GitHub",
 | 
			
		||||
  "license": "MIT",
 | 
			
		||||
  "dependencies": {
 | 
			
		||||
    "@actions/cache": "^1.0.7",
 | 
			
		||||
    "@actions/core": "^1.2.6",
 | 
			
		||||
    "@actions/cache": "^1.0.8",
 | 
			
		||||
    "@actions/core": "^1.10.0",
 | 
			
		||||
    "@actions/exec": "^1.0.1",
 | 
			
		||||
    "@actions/io": "^1.0.1"
 | 
			
		||||
    "@actions/io": "^1.1.0"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@types/jest": "^24.0.13",
 | 
			
		||||
    "@types/nock": "^11.1.0",
 | 
			
		||||
    "@types/node": "^12.0.4",
 | 
			
		||||
    "@types/node": "^12.20.7",
 | 
			
		||||
    "@typescript-eslint/eslint-plugin": "^2.7.0",
 | 
			
		||||
    "@typescript-eslint/parser": "^2.7.0",
 | 
			
		||||
    "@zeit/ncc": "^0.20.5",
 | 
			
		||||
    "eslint": "^6.6.0",
 | 
			
		||||
    "eslint-config-prettier": "^6.5.0",
 | 
			
		||||
    "eslint-plugin-import": "^2.18.2",
 | 
			
		||||
    "eslint-plugin-jest": "^23.0.3",
 | 
			
		||||
    "eslint-plugin-prettier": "^3.1.1",
 | 
			
		||||
    "eslint-config-prettier": "^6.15.0",
 | 
			
		||||
    "eslint-plugin-import": "^2.22.1",
 | 
			
		||||
    "eslint-plugin-jest": "^23.20.0",
 | 
			
		||||
    "eslint-plugin-prettier": "^3.3.1",
 | 
			
		||||
    "eslint-plugin-simple-import-sort": "^5.0.2",
 | 
			
		||||
    "jest": "^24.8.0",
 | 
			
		||||
    "jest-circus": "^24.7.1",
 | 
			
		||||
    "nock": "^11.7.0",
 | 
			
		||||
    "prettier": "^1.19.1",
 | 
			
		||||
    "ts-jest": "^24.0.2",
 | 
			
		||||
    "typescript": "^3.7.3"
 | 
			
		||||
    "ts-jest": "^26.5.4",
 | 
			
		||||
    "typescript": "^3.9.9"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,9 @@ import * as utils from "./utils/actionUtils";
 | 
			
		||||
async function run(): Promise<void> {
 | 
			
		||||
    try {
 | 
			
		||||
        if (utils.isGhes()) {
 | 
			
		||||
            utils.logWarning("Cache action is not supported on GHES");
 | 
			
		||||
            utils.logWarning(
 | 
			
		||||
                "Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
 | 
			
		||||
            );
 | 
			
		||||
            utils.setCacheHitOutput(false);
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
@ -4,10 +4,17 @@ import * as core from "@actions/core";
 | 
			
		||||
import { Events, Inputs, State } from "./constants";
 | 
			
		||||
import * as utils from "./utils/actionUtils";
 | 
			
		||||
 | 
			
		||||
// Catch and log any unhandled exceptions.  These exceptions can leak out of the uploadChunk method in
 | 
			
		||||
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
 | 
			
		||||
// throw an uncaught exception.  Instead of failing this action, just warn.
 | 
			
		||||
process.on("uncaughtException", e => utils.logWarning(e.message));
 | 
			
		||||
 | 
			
		||||
async function run(): Promise<void> {
 | 
			
		||||
    try {
 | 
			
		||||
        if (utils.isGhes()) {
 | 
			
		||||
            utils.logWarning("Cache action is not supported on GHES");
 | 
			
		||||
            utils.logWarning(
 | 
			
		||||
                "Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
 | 
			
		||||
            );
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user