You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cache/examples.md

144 lines
3.1 KiB
Markdown

# Examples
- [C# - Nuget](#c---nuget)
5 years ago
- [Elixir - Mix](#elixir---mix)
- [Go - Modules](#go---modules)
- [Java - Gradle](#java---gradle)
- [Java - Maven](#java---maven)
5 years ago
- [Node - npm](#node---npm)
- [Node - Yarn](#node---yarn)
- [Ruby - Gem](#ruby---gem)
- [Rust - Cargo](#rust---cargo)
5 years ago
- [Swift, Objective-C - Carthage](#swift-objective-c---carthage)
- [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods)
5 years ago
## C# - Nuget
Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/package-references-in-project-files#locking-dependencies):
```yaml
5 years ago
- uses: actions/cache@v1
with:
5 years ago
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
5 years ago
${{ runner.os }}-nuget-
```
5 years ago
## Elixir - Mix
```yaml
5 years ago
- uses: actions/cache@v1
with:
5 years ago
path: deps
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
5 years ago
${{ runner.os }}-mix-
```
5 years ago
## Go - Modules
```yaml
5 years ago
- uses: actions/cache@v1
with:
5 years ago
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
5 years ago
${{ runner.os }}-go-
```
## Java - Gradle
```yaml
5 years ago
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: |
${{ runner.os }}-gradle-
```
## Java - Maven
```yaml
5 years ago
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
```
5 years ago
## Node - npm
```yaml
5 years ago
- uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
```
5 years ago
## Node - Yarn
```yaml
5 years ago
- uses: actions/cache@v1
with:
5 years ago
path: ~/.cache/yarn
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}{1}', github.workspace, '/yarn.lock')) }}
restore-keys: |
5 years ago
${{ runner.os }}-yarn-
```
## Ruby - Gem
```yaml
5 years ago
- uses: actions/cache@v1
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gem-
```
## Rust - Cargo
5 years ago
```yaml
- name: Cache cargo registry
5 years ago
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
5 years ago
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
5 years ago
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
```
5 years ago
## 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-
```