@ -1,22 +1,32 @@
# Examples
# Examples
- [C# - NuGet ](#c---nuget )
- [Examples ](#examples )
- [Elixir - Mix ](#elixir---mix )
- [C# - NuGet ](#c---nuget )
- [Go - Modules ](#go---modules )
- [Elixir - Mix ](#elixir---mix )
- [Haskell - Cabal ](#haskell---cabal )
- [Go - Modules ](#go---modules )
- [Java - Gradle ](#java---gradle )
- [Haskell - Cabal ](#haskell---cabal )
- [Java - Maven ](#java---maven )
- [Java - Gradle ](#java---gradle )
- [Node - npm ](#node---npm )
- [Java - Maven ](#java---maven )
- [Node - Yarn ](#node---yarn )
- [Node - npm ](#node---npm )
- [PHP - Composer ](#php---composer )
- [macOS and Ubuntu ](#macos-and-ubuntu )
- [Python - pip ](#python---pip )
- [Windows ](#windows )
- [R - renv ](#r---renv )
- [Using multiple systems and `npm config` ](#using-multiple-systems-and-npm-config )
- [Ruby - Bundler ](#ruby---bundler )
- [Node - Yarn ](#node---yarn )
- [Rust - Cargo ](#rust---cargo )
- [OCaml/Reason - esy ](#ocamlreason---esy )
- [Scala - SBT ](#scala---sbt )
- [PHP - Composer ](#php---composer )
- [Swift, Objective-C - Carthage ](#swift-objective-c---carthage )
- [Python - pip ](#python---pip )
- [Swift, Objective-C - CocoaPods ](#swift-objective-c---cocoapods )
- [Simple example ](#simple-example )
- [Swift - Swift Package Manager ](#swift---swift-package-manager )
- [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 )
- [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
## C# - NuGet
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 ):
@ -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