mirror of
				https://github.com/actions/cache.git
				synced 2025-11-01 04:28:39 +08:00 
			
		
		
		
	Adding examples for OCaml/esy (#199)
* Adding examples for esy as a workflow for OCaml files * track v1 instead of v1.1.2 Co-Authored-By: Josh Gross <joshmgross@github.com> * add link in the readme for ocaml-esy * ocaml -> ocaml/reason * link in readme says ocaml/reason Co-authored-by: Josh Gross <joshmgross@github.com>
This commit is contained in:
		
							parent
							
								
									8e9c167fd7
								
							
						
					
					
						commit
						826785142a
					
				|  | @ -68,6 +68,7 @@ See [Examples](examples.md) for a list of `actions/cache` implementations for us | ||||||
| - [Java - Maven](./examples.md#java---maven) | - [Java - Maven](./examples.md#java---maven) | ||||||
| - [Node - npm](./examples.md#node---npm) | - [Node - npm](./examples.md#node---npm) | ||||||
| - [Node - Yarn](./examples.md#node---yarn) | - [Node - Yarn](./examples.md#node---yarn) | ||||||
|  | - [OCaml/Reason - esy](./examples.md##ocamlreason---esy) | ||||||
| - [PHP - Composer](./examples.md#php---composer) | - [PHP - Composer](./examples.md#php---composer) | ||||||
| - [Python - pip](./examples.md#python---pip) | - [Python - pip](./examples.md#python---pip) | ||||||
| - [R - renv](./examples.md#r---renv) | - [R - renv](./examples.md#r---renv) | ||||||
|  |  | ||||||
							
								
								
									
										37
									
								
								examples.md
									
									
									
									
									
								
							
							
						
						
									
										37
									
								
								examples.md
									
									
									
									
									
								
							|  | @ -1,5 +1,6 @@ | ||||||
| # Examples | # Examples | ||||||
| 
 | 
 | ||||||
|  | - [Examples](#examples) | ||||||
|   - [C# - NuGet](#c---nuget) |   - [C# - NuGet](#c---nuget) | ||||||
|   - [Elixir - Mix](#elixir---mix) |   - [Elixir - Mix](#elixir---mix) | ||||||
|   - [Go - Modules](#go---modules) |   - [Go - Modules](#go---modules) | ||||||
|  | @ -7,10 +8,19 @@ | ||||||
|   - [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) | ||||||
|  |     - [Windows](#windows) | ||||||
|  |     - [Using multiple systems and `npm config`](#using-multiple-systems-and-npm-config) | ||||||
|   - [Node - Yarn](#node---yarn) |   - [Node - Yarn](#node---yarn) | ||||||
|  |   - [OCaml/Reason - esy](#ocamlreason---esy) | ||||||
|   - [PHP - Composer](#php---composer) |   - [PHP - Composer](#php---composer) | ||||||
|   - [Python - pip](#python---pip) |   - [Python - pip](#python---pip) | ||||||
|  |     - [Simple example](#simple-example) | ||||||
|  |     - [Multiple OS's in a workflow](#multiple-oss-in-a-workflow) | ||||||
|  |     - [Using a script to get cache location](#using-a-script-to-get-cache-location) | ||||||
|   - [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) | ||||||
|  | @ -170,6 +180,33 @@ The yarn cache directory will depend on your operating system and version of `ya | ||||||
|       ${{ runner.os }}-yarn- |       ${{ runner.os }}-yarn- | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
|  | ## OCaml/Reason - esy | ||||||
|  | Esy allows you to export built dependencies and import pre-built dependencies. | ||||||
|  | ```yaml | ||||||
|  |     - name: Restore Cache | ||||||
|  |       id: restore-cache | ||||||
|  |       uses: actions/cache@v1 | ||||||
|  |       with: | ||||||
|  |         path: _export | ||||||
|  |         key:  ${{ runner.os }}-esy-${{ hashFiles('esy.lock/index.json') }} | ||||||
|  |         restore-keys: | | ||||||
|  |           ${{ runner.os }}-esy- | ||||||
|  |     - name: Esy install | ||||||
|  |       run: 'esy install' | ||||||
|  |     - name: Import Cache | ||||||
|  |       run: | | ||||||
|  |         esy import-dependencies _export | ||||||
|  |         rm -rf _export | ||||||
|  | 
 | ||||||
|  |     ...(Build job)... | ||||||
|  | 
 | ||||||
|  |     # Re-export dependencies if anything has changed or if it is the first time | ||||||
|  |     - name: Setting dependency cache  | ||||||
|  |       run: | | ||||||
|  |         esy export-dependencies | ||||||
|  |       if: steps.restore-cache.outputs.cache-hit != 'true' | ||||||
|  | ``` | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| ## PHP - Composer | ## PHP - Composer | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Sacha Ayoun
						Sacha Ayoun