@ -1,48 +1,48 @@
# Examples
- [Node - npm ](#node---npm )
- [Node - Yarn ](#node---yarn )
- [C# - Nuget ](#c---nuget )
- [Elixir - Mix ](#elixir---mix )
- [Go - Modules ](#go---modules )
- [Java - Gradle ](#java---gradle )
- [Java - Maven ](#java---maven )
- [Swift, Objective-C - Carthage](#swift-objective-c---carthage )
- [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods )
- [Node - npm](#node---npm )
- [Node - Yarn](#node---yarn )
- [Ruby - Gem ](#ruby---gem )
- [Go - Modules ](#go---modules )
- [Elixir - Mix ](#elixir---mix )
- [Rust - Cargo ](#rust---cargo )
- [Swift, Objective-C - Carthage ](#swift-objective-c---carthage )
- [Swift, Objective-C - CocoaPods ](#swift-objective-c---cocoapods )
## Node - npm
## C# - Nuget
Using [NuGet lock files ](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies ):
```yaml
- uses: actions/cache@v1
with:
path: node_modul es
key: ${{ runner.os }}-node-${{ hashFiles('**/package- lock.json') }}
path: ~/.nuget/packag es
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages. lock.json') }}
restore-keys: |
${{ runner.os }}-node -
${{ runner.os }}-nuget -
```
## Node - Yarn
## Elixir - Mix
```yaml
- uses: actions/cache@v1
with:
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn .lock')) }}
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix .lock')) }}
restore-keys: |
${{ runner.os }}-yarn -
${{ runner.os }}-mix -
```
## C# - Nuget
Using [NuGet lock files ](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies ):
## Go - Modules
```yaml
- uses: actions/cache@v1
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json ') }}
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum ') }}
restore-keys: |
${{ runner.os }}-nuget -
${{ runner.os }}-go -
```
## Java - Gradle
@ -67,26 +67,26 @@ Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/packa
${{ runner.os }}-maven-
```
## Swift, Objective-C - Carthage
## Node - npm
```yaml
uses: actions/cache@v1
with:
path: Carthage
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved ') }}
restore-keys: |
${{ runner.os }}-carthag e-
- uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json ') }}
restore-keys: |
${{ runner.os }}-nod e-
```
## Swift, Objective-C - CocoaPods
## Node - Yarn
```yaml
- uses: actions/cache@v1
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock' ) }}
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock') ) }}
restore-keys: |
${{ runner.os }}-pods -
${{ runner.os }}-yarn -
```
## Ruby - Gem
@ -100,30 +100,9 @@ uses: actions/cache@v1
${{ runner.os }}-gem-
```
## Go - Modules
```yaml
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
```
## Elixir - Mix
```yaml
- uses: actions/cache@v1
with:
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-
```
## Rust - Cargo
```
```yaml
- name: Cache cargo registry
uses: actions/cache@v1
with:
@ -140,3 +119,25 @@ uses: actions/cache@v1
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
```
## Swift, Objective-C - Carthage
```yaml
- uses: actions/cache@v1
with:
path: Carthage
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
restore-keys: |
${{ runner.os }}-carthage-
```
## Swift, Objective-C - CocoaPods
```yaml
- uses: actions/cache@v1
with:
path: Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
```