mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-20 07:44:42 +08:00
chore: cache@v1 -> cache@v1.0.3
This commit is contained in:
parent
3d01b4eb53
commit
96684b69c9
3 changed files with 24 additions and 24 deletions
2
.github/workflows/workflow.yml
vendored
2
.github/workflows/workflow.yml
vendored
|
@ -34,7 +34,7 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=dir::$(npm config get cache)"
|
echo "::set-output name=dir::$(npm config get cache)"
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.npm-cache.outputs.dir }}
|
path: ${{ steps.npm-cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
|
|
@ -41,7 +41,7 @@ jobs:
|
||||||
|
|
||||||
- name: Cache Primes
|
- name: Cache Primes
|
||||||
id: cache-primes
|
id: cache-primes
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: prime-numbers
|
path: prime-numbers
|
||||||
key: ${{ runner.os }}-primes
|
key: ${{ runner.os }}-primes
|
||||||
|
@ -71,7 +71,7 @@ Example:
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v1
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
path: path/to/dependencies
|
path: path/to/dependencies
|
||||||
|
|
42
examples.md
42
examples.md
|
@ -18,7 +18,7 @@
|
||||||
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):
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ~/.nuget/packages
|
path: ~/.nuget/packages
|
||||||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
||||||
|
@ -28,7 +28,7 @@ Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/packa
|
||||||
|
|
||||||
## Elixir - Mix
|
## Elixir - Mix
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: deps
|
path: deps
|
||||||
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
|
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
|
||||||
|
@ -39,7 +39,7 @@ Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/packa
|
||||||
## Go - Modules
|
## Go - Modules
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ~/go/pkg/mod
|
path: ~/go/pkg/mod
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
@ -50,7 +50,7 @@ Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/packa
|
||||||
## Java - Gradle
|
## Java - Gradle
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ~/.gradle/caches
|
path: ~/.gradle/caches
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
||||||
|
@ -61,7 +61,7 @@ Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/packa
|
||||||
## Java - Maven
|
## Java - Maven
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
|
@ -78,7 +78,7 @@ For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` o
|
||||||
### macOS and Ubuntu
|
### macOS and Ubuntu
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
path: ~/.npm
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
@ -89,7 +89,7 @@ For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` o
|
||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ~\AppData\Roaming\npm-cache
|
path: ~\AppData\Roaming\npm-cache
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**\package-lock.json') }}
|
key: ${{ runner.os }}-node-${{ hashFiles('**\package-lock.json') }}
|
||||||
|
@ -104,7 +104,7 @@ For npm, cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` o
|
||||||
id: npm-cache
|
id: npm-cache
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=dir::$(npm config get cache)"
|
echo "::set-output name=dir::$(npm config get cache)"
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.npm-cache.outputs.dir }}
|
path: ${{ steps.npm-cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
|
@ -120,7 +120,7 @@ The yarn cache directory will depend on your operating system and version of `ya
|
||||||
id: yarn-cache
|
id: yarn-cache
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache.outputs.dir }}
|
path: ${{ steps.yarn-cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
@ -135,7 +135,7 @@ The yarn cache directory will depend on your operating system and version of `ya
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
echo "::set-output name=dir::$(composer config cache-files-dir)"
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.composer-cache.outputs.dir }}
|
path: ${{ steps.composer-cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||||
|
@ -154,7 +154,7 @@ Locations:
|
||||||
|
|
||||||
### Simple example
|
### Simple example
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pip
|
path: ~/.cache/pip
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||||
|
@ -167,7 +167,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
|
||||||
### Multiple OS's in a workflow
|
### Multiple OS's in a workflow
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
if: startsWith(runner.os, 'Linux')
|
if: startsWith(runner.os, 'Linux')
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pip
|
path: ~/.cache/pip
|
||||||
|
@ -175,7 +175,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pip-
|
${{ runner.os }}-pip-
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
if: startsWith(runner.os, 'macOS')
|
if: startsWith(runner.os, 'macOS')
|
||||||
with:
|
with:
|
||||||
path: ~/Library/Caches/pip
|
path: ~/Library/Caches/pip
|
||||||
|
@ -183,7 +183,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-pip-
|
${{ runner.os }}-pip-
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
if: startsWith(runner.os, 'Windows')
|
if: startsWith(runner.os, 'Windows')
|
||||||
with:
|
with:
|
||||||
path: ~\AppData\Local\pip\Cache
|
path: ~\AppData\Local\pip\Cache
|
||||||
|
@ -201,7 +201,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
|
||||||
run: |
|
run: |
|
||||||
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
|
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
|
||||||
|
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.pip-cache.outputs.dir }}
|
path: ${{ steps.pip-cache.outputs.dir }}
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||||
|
@ -212,7 +212,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
|
||||||
## Ruby - Gem
|
## Ruby - Gem
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: vendor/bundle
|
path: vendor/bundle
|
||||||
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
||||||
|
@ -232,17 +232,17 @@ When dependencies are installed later in the workflow, we must specify the same
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Cache cargo registry
|
- name: Cache cargo registry
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ~/.cargo/registry
|
path: ~/.cargo/registry
|
||||||
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
|
||||||
- name: Cache cargo index
|
- name: Cache cargo index
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: ~/.cargo/git
|
path: ~/.cargo/git
|
||||||
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
|
||||||
- name: Cache cargo build
|
- name: Cache cargo build
|
||||||
uses: actions/cache@v1
|
uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: target
|
path: target
|
||||||
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
|
||||||
|
@ -251,7 +251,7 @@ When dependencies are installed later in the workflow, we must specify the same
|
||||||
## Swift, Objective-C - Carthage
|
## Swift, Objective-C - Carthage
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: Carthage
|
path: Carthage
|
||||||
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
|
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
|
||||||
|
@ -262,7 +262,7 @@ When dependencies are installed later in the workflow, we must specify the same
|
||||||
## Swift, Objective-C - CocoaPods
|
## Swift, Objective-C - CocoaPods
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v1
|
- uses: actions/cache@v1.0.3
|
||||||
with:
|
with:
|
||||||
path: Pods
|
path: Pods
|
||||||
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
||||||
|
|
Loading…
Add table
Reference in a new issue