mirror of
https://github.com/actions/cache.git
synced 2025-05-22 17:01:45 +00:00
Merge b13b69db36
into d2583f08bc
This commit is contained in:
commit
15b982f305
@ -9,15 +9,14 @@
|
|||||||
"plugin:import/errors",
|
"plugin:import/errors",
|
||||||
"plugin:import/warnings",
|
"plugin:import/warnings",
|
||||||
"plugin:import/typescript",
|
"plugin:import/typescript",
|
||||||
"plugin:prettier/recommended",
|
"plugin:prettier/recommended"
|
||||||
"prettier/@typescript-eslint"
|
|
||||||
],
|
],
|
||||||
"plugins": ["@typescript-eslint", "simple-import-sort", "jest"],
|
"plugins": ["@typescript-eslint", "simple-import-sort", "jest"],
|
||||||
"rules": {
|
"rules": {
|
||||||
"import/first": "error",
|
"import/first": "error",
|
||||||
"import/newline-after-import": "error",
|
"import/newline-after-import": "error",
|
||||||
"import/no-duplicates": "error",
|
"import/no-duplicates": "error",
|
||||||
"simple-import-sort/sort": "error",
|
"simple-import-sort/imports": "error",
|
||||||
"sort-imports": "off"
|
"sort-imports": "off"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -1 +1,2 @@
|
|||||||
.licenses/** -diff linguist-generated=true
|
.licenses/** -diff linguist-generated=true
|
||||||
|
* text=auto eol=lf
|
2
.github/CODEOWNERS
vendored
2
.github/CODEOWNERS
vendored
@ -1 +1 @@
|
|||||||
* @actions/artifacts-actions
|
* @actions/actions-cache
|
||||||
|
52
.github/workflows/check-dist.yml
vendored
Normal file
52
.github/workflows/check-dist.yml
vendored
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
# `dist/index.js` is a special file in Actions.
|
||||||
|
# When you reference an action with `uses:` in a workflow,
|
||||||
|
# `index.js` is the code that will run.
|
||||||
|
# For our project, we generate this file through a build process
|
||||||
|
# from other source files.
|
||||||
|
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
|
||||||
|
name: Check dist/
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
pull_request:
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-dist:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Set Node.js 12.x
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: 12.x
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: npm ci
|
||||||
|
|
||||||
|
- name: Rebuild the dist/ directory
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Compare the expected and actual dist/ directories
|
||||||
|
run: |
|
||||||
|
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
|
||||||
|
echo "Detected uncommitted changes after build. See status below:"
|
||||||
|
git diff
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
id: diff
|
||||||
|
|
||||||
|
# If index.js was different than expected, upload the expected version as an artifact
|
||||||
|
- uses: actions/upload-artifact@v2
|
||||||
|
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
|
||||||
|
with:
|
||||||
|
name: dist
|
||||||
|
path: dist/
|
22
.github/workflows/close-inactive-issues.yml
vendored
Normal file
22
.github/workflows/close-inactive-issues.yml
vendored
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
name: Close inactive issues
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
- cron: "30 8 * * *"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
close-issues:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
issues: write
|
||||||
|
pull-requests: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/stale@v3
|
||||||
|
with:
|
||||||
|
days-before-issue-stale: 365
|
||||||
|
days-before-issue-close: 5
|
||||||
|
stale-issue-label: "stale"
|
||||||
|
stale-issue-message: "This issue is stale because it has been open for 365 days with no activity. Leave a comment to avoid closing this issue in 5 days."
|
||||||
|
close-issue-message: "This issue was closed because it has been inactive for 5 days since being marked as stale."
|
||||||
|
days-before-pr-stale: -1
|
||||||
|
days-before-pr-close: -1
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
8
.github/workflows/licensed.yml
vendored
8
.github/workflows/licensed.yml
vendored
@ -1,8 +1,12 @@
|
|||||||
name: Licensed
|
name: Licensed
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push: {branches: main}
|
push:
|
||||||
pull_request: {branches: main}
|
branches:
|
||||||
|
- main
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
|
19
.github/workflows/workflow.yml
vendored
19
.github/workflows/workflow.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, ubuntu-16.04, windows-latest, macOS-latest]
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
@ -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)"
|
||||||
- name: Restore npm cache
|
- name: Restore npm cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
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') }}
|
||||||
@ -47,23 +47,12 @@ jobs:
|
|||||||
run: npm run lint
|
run: npm run lint
|
||||||
- name: Build & Test
|
- name: Build & Test
|
||||||
run: npm run test
|
run: npm run test
|
||||||
- name: Ensure dist/ folder is up-to-date
|
|
||||||
if: ${{ runner.os == 'Linux' }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
npm run build
|
|
||||||
if [ "$(git diff --ignore-space-at-eol | wc -l)" -gt "0" ]; then
|
|
||||||
echo "Detected uncommitted changes after build. See status below:"
|
|
||||||
git diff
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
# End to end save and restore
|
# End to end save and restore
|
||||||
test-save:
|
test-save:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, ubuntu-16.04, windows-latest, macOS-latest]
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
@ -86,7 +75,7 @@ jobs:
|
|||||||
needs: test-save
|
needs: test-save
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, ubuntu-16.04, windows-latest, macOS-latest]
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
|
BIN
.licenses/npm/@actions/cache.dep.yml
generated
BIN
.licenses/npm/@actions/cache.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/core.dep.yml
generated
BIN
.licenses/npm/@actions/core.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/exec.dep.yml
generated
BIN
.licenses/npm/@actions/exec.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/glob.dep.yml
generated
BIN
.licenses/npm/@actions/glob.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/http-client.dep.yml
generated
BIN
.licenses/npm/@actions/http-client.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@actions/io.dep.yml
generated
BIN
.licenses/npm/@actions/io.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/abort-controller.dep.yml
generated
BIN
.licenses/npm/@azure/abort-controller.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-asynciterator-polyfill.dep.yml
generated
BIN
.licenses/npm/@azure/core-asynciterator-polyfill.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
BIN
.licenses/npm/@azure/core-auth.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-http.dep.yml
generated
BIN
.licenses/npm/@azure/core-http.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
BIN
.licenses/npm/@azure/core-lro.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
BIN
.licenses/npm/@azure/core-paging.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@azure/logger.dep.yml
generated
BIN
.licenses/npm/@azure/logger.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
BIN
.licenses/npm/@azure/ms-rest-js.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
BIN
.licenses/npm/@azure/storage-blob.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@opentelemetry/api-0.10.2.dep.yml
generated
BIN
.licenses/npm/@opentelemetry/api-0.10.2.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@opentelemetry/api-0.6.1.dep.yml
generated
BIN
.licenses/npm/@opentelemetry/api-0.6.1.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/@opentelemetry/context-base-0.10.2.dep.yml
generated
BIN
.licenses/npm/@opentelemetry/context-base-0.10.2.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@opentelemetry/context-base-0.6.1.dep.yml
generated
BIN
.licenses/npm/@opentelemetry/context-base-0.6.1.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/node-fetch.dep.yml
generated
BIN
.licenses/npm/@types/node-fetch.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/node.dep.yml
generated
BIN
.licenses/npm/@types/node.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/@types/tunnel.dep.yml
generated
BIN
.licenses/npm/@types/tunnel.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/balanced-match.dep.yml
generated
BIN
.licenses/npm/balanced-match.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/events.dep.yml
generated
BIN
.licenses/npm/events.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/form-data-4.0.0.dep.yml
generated
Normal file
BIN
.licenses/npm/form-data-4.0.0.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/mime-db.dep.yml
generated
BIN
.licenses/npm/mime-db.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/mime-types.dep.yml
generated
BIN
.licenses/npm/mime-types.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/node-fetch.dep.yml
generated
BIN
.licenses/npm/node-fetch.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/tslib-1.13.0.dep.yml
generated
BIN
.licenses/npm/tslib-1.13.0.dep.yml
generated
Binary file not shown.
BIN
.licenses/npm/tslib-1.14.1.dep.yml
generated
BIN
.licenses/npm/tslib-1.14.1.dep.yml
generated
Binary file not shown.
Binary file not shown.
BIN
.licenses/npm/webidl-conversions.dep.yml
generated
Normal file
BIN
.licenses/npm/webidl-conversions.dep.yml
generated
Normal file
Binary file not shown.
BIN
.licenses/npm/whatwg-url.dep.yml
generated
Normal file
BIN
.licenses/npm/whatwg-url.dep.yml
generated
Normal file
Binary file not shown.
38
README.md
38
README.md
@ -2,24 +2,27 @@
|
|||||||
|
|
||||||
This action allows caching dependencies and build outputs to improve workflow execution time.
|
This action allows caching dependencies and build outputs to improve workflow execution time.
|
||||||
|
|
||||||
<a href="https://github.com/actions/cache/actions?query=workflow%3ATests"><img alt="GitHub Actions status" src="https://github.com/actions/cache/workflows/Tests/badge.svg?branch=main&event=push"></a>
|
[](https://github.com/actions/cache/actions/workflows/workflow.yml)
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
See ["Caching dependencies to speed up workflows"](https://help.github.com/github/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows).
|
See ["Caching dependencies to speed up workflows"](https://help.github.com/github/automating-your-workflow-with-github-actions/caching-dependencies-to-speed-up-workflows).
|
||||||
|
|
||||||
## What's New
|
## What's New
|
||||||
|
### v3
|
||||||
|
* Updated the minimum runner version support from node 12 -> node 16.
|
||||||
|
|
||||||
|
### v2
|
||||||
|
* Increased the cache size limit to 10 GB.
|
||||||
* Added support for multiple paths, [glob patterns](https://github.com/actions/toolkit/tree/main/packages/glob), and single file caches.
|
* Added support for multiple paths, [glob patterns](https://github.com/actions/toolkit/tree/main/packages/glob), and single file caches.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Cache multiple paths
|
- name: Cache multiple paths
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/cache
|
~/cache
|
||||||
!~/cache/exclude
|
!~/cache/exclude
|
||||||
**/node_modules
|
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -35,6 +38,8 @@ Refer [here](https://github.com/actions/cache/blob/v1/README.md) for previous ve
|
|||||||
### Pre-requisites
|
### Pre-requisites
|
||||||
Create a workflow `.yml` file in your repositories `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
|
Create a workflow `.yml` file in your repositories `.github/workflows` directory. An [example workflow](#example-workflow) is available below. For more information, reference the GitHub Help Documentation for [Creating a workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file).
|
||||||
|
|
||||||
|
If you are using this inside a container, a POSIX-compliant `tar` needs to be included and accessible in the execution path.
|
||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
* `path` - A list of files, directories, and wildcard patterns to cache and restore. See [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns.
|
* `path` - A list of files, directories, and wildcard patterns to cache and restore. See [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns.
|
||||||
@ -68,7 +73,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Cache Primes
|
- name: Cache Primes
|
||||||
id: cache-primes
|
id: cache-primes
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: prime-numbers
|
path: prime-numbers
|
||||||
key: ${{ runner.os }}-primes
|
key: ${{ runner.os }}-primes
|
||||||
@ -87,11 +92,13 @@ Every programming language and framework has its own way of caching.
|
|||||||
|
|
||||||
See [Examples](examples.md) for a list of `actions/cache` implementations for use with:
|
See [Examples](examples.md) for a list of `actions/cache` implementations for use with:
|
||||||
|
|
||||||
- [C# - Nuget](./examples.md#c---nuget)
|
- [C# - NuGet](./examples.md#c---nuget)
|
||||||
- [D - DUB](./examples.md#d---dub)
|
- [D - DUB](./examples.md#d---dub)
|
||||||
|
- [Deno](./examples.md#deno)
|
||||||
- [Elixir - Mix](./examples.md#elixir---mix)
|
- [Elixir - Mix](./examples.md#elixir---mix)
|
||||||
- [Go - Modules](./examples.md#go---modules)
|
- [Go - Modules](./examples.md#go---modules)
|
||||||
- [Haskell - Cabal](./examples.md#haskell---cabal)
|
- [Haskell - Cabal](./examples.md#haskell---cabal)
|
||||||
|
- [Haskell - Stack](./examples.md#haskell---stack)
|
||||||
- [Java - Gradle](./examples.md#java---gradle)
|
- [Java - Gradle](./examples.md#java---gradle)
|
||||||
- [Java - Maven](./examples.md#java---maven)
|
- [Java - Maven](./examples.md#java---maven)
|
||||||
- [Node - npm](./examples.md#node---npm)
|
- [Node - npm](./examples.md#node---npm)
|
||||||
@ -100,6 +107,7 @@ See [Examples](examples.md) for a list of `actions/cache` implementations for us
|
|||||||
- [OCaml/Reason - esy](./examples.md#ocamlreason---esy)
|
- [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)
|
||||||
|
- [Python - pipenv](./examples.md#python---pipenv)
|
||||||
- [R - renv](./examples.md#r---renv)
|
- [R - renv](./examples.md#r---renv)
|
||||||
- [Ruby - Bundler](./examples.md#ruby---bundler)
|
- [Ruby - Bundler](./examples.md#ruby---bundler)
|
||||||
- [Rust - Cargo](./examples.md#rust---cargo)
|
- [Rust - Cargo](./examples.md#rust---cargo)
|
||||||
@ -115,7 +123,7 @@ A cache key can include any of the contexts, functions, literals, and operators
|
|||||||
For example, using the [`hashFiles`](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#hashfiles) function allows you to create a new cache when dependencies change.
|
For example, using the [`hashFiles`](https://help.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#hashfiles) function allows you to create a new cache when dependencies change.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
path/to/dependencies
|
path/to/dependencies
|
||||||
@ -133,7 +141,7 @@ Additionally, you can use arbitrary command output in a cache key, such as a dat
|
|||||||
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
|
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: path/to/dependencies
|
path: path/to/dependencies
|
||||||
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/lockfiles') }}
|
key: ${{ runner.os }}-${{ steps.get-date.outputs.date }}-${{ hashFiles('**/lockfiles') }}
|
||||||
@ -143,7 +151,7 @@ See [Using contexts to create cache keys](https://help.github.com/en/actions/con
|
|||||||
|
|
||||||
## Cache Limits
|
## Cache Limits
|
||||||
|
|
||||||
A repository can have up to 5GB of caches. Once the 5GB limit is reached, older caches will be evicted based on when the cache was last accessed. Caches that are not accessed within the last week will also be evicted.
|
A repository can have up to 10GB of caches. Once the 10GB limit is reached, older caches will be evicted based on when the cache was last accessed. Caches that are not accessed within the last week will also be evicted.
|
||||||
|
|
||||||
## Skipping steps based on cache-hit
|
## Skipping steps based on cache-hit
|
||||||
|
|
||||||
@ -154,7 +162,7 @@ Example:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
id: cache
|
id: cache
|
||||||
with:
|
with:
|
||||||
path: path/to/dependencies
|
path: path/to/dependencies
|
||||||
@ -167,6 +175,18 @@ steps:
|
|||||||
|
|
||||||
> Note: The `id` defined in `actions/cache` must match the `id` in the `if` statement (i.e. `steps.[ID].outputs.cache-hit`)
|
> Note: The `id` defined in `actions/cache` must match the `id` in the `if` statement (i.e. `steps.[ID].outputs.cache-hit`)
|
||||||
|
|
||||||
|
## Known limitation
|
||||||
|
|
||||||
|
- `action/cache` is currently not supported on GitHub Enterprise Server. <https://github.com/github/roadmap/issues/273> is tracking this.
|
||||||
|
|
||||||
|
Since GitHub Enterprise Server uses self-hosted runners, dependencies are typically cached on the runner by whatever dependency management tool is being used (npm, maven, etc.). This eliminates the need for explicit caching in some scenarios.
|
||||||
|
|
||||||
|
## Changelog schedule and history
|
||||||
|
|
||||||
|
| Status | Version | Date | Highlights |
|
||||||
|
|:---|:---|:---|:---|
|
||||||
|
| Published | v3.0.0 | Mar 21st, 2022 | - Updated minimum runner version support from node 12 -> node 16 <br> |
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
We would love for you to contribute to `actions/cache`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
We would love for you to contribute to `actions/cache`, pull requests are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) for more information.
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ test("isGhes returns true if server url is not github.com", () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
test("isGhes returns true when server url is github.com", () => {
|
test("isGhes returns false when server url is github.com", () => {
|
||||||
try {
|
try {
|
||||||
process.env["GITHUB_SERVER_URL"] = "http://github.com";
|
process.env["GITHUB_SERVER_URL"] = "http://github.com";
|
||||||
expect(actionUtils.isGhes()).toBe(false);
|
expect(actionUtils.isGhes()).toBe(false);
|
||||||
|
@ -68,7 +68,7 @@ test("restore on GHES should no-op", async () => {
|
|||||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
|
expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
|
||||||
expect(logWarningMock).toHaveBeenCalledWith(
|
expect(logWarningMock).toHaveBeenCalledWith(
|
||||||
"Cache action is not supported on GHES"
|
"Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ test("save on GHES should no-op", async () => {
|
|||||||
|
|
||||||
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
expect(saveCacheMock).toHaveBeenCalledTimes(0);
|
||||||
expect(logWarningMock).toHaveBeenCalledWith(
|
expect(logWarningMock).toHaveBeenCalledWith(
|
||||||
"Cache action is not supported on GHES"
|
"Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ outputs:
|
|||||||
cache-hit:
|
cache-hit:
|
||||||
description: 'A boolean value to indicate an exact match was found for the primary key'
|
description: 'A boolean value to indicate an exact match was found for the primary key'
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node16'
|
||||||
main: 'dist/restore/index.js'
|
main: 'dist/restore/index.js'
|
||||||
post: 'dist/save/index.js'
|
post: 'dist/save/index.js'
|
||||||
post-if: 'success()'
|
post-if: 'success()'
|
||||||
|
50214
dist/restore/index.js
vendored
50214
dist/restore/index.js
vendored
File diff suppressed because one or more lines are too long
50219
dist/save/index.js
vendored
50219
dist/save/index.js
vendored
File diff suppressed because one or more lines are too long
395
examples.md
395
examples.md
@ -1,42 +1,51 @@
|
|||||||
# Examples
|
# Examples
|
||||||
|
|
||||||
- [Examples](#examples)
|
- [C# - NuGet](#c---nuget)
|
||||||
- [C# - NuGet](#c---nuget)
|
- [D - DUB](#d---dub)
|
||||||
- [D - DUB](#d---dub)
|
- [POSIX](#posix)
|
||||||
- [Elixir - Mix](#elixir---mix)
|
- [Windows](#windows)
|
||||||
- [Go - Modules](#go---modules)
|
- [Deno](#deno)
|
||||||
- [Haskell - Cabal](#haskell---cabal)
|
- [Linux](#linux)
|
||||||
- [Java - Gradle](#java---gradle)
|
- [macOS](#macos)
|
||||||
- [Java - Maven](#java---maven)
|
- [Windows](#windows-1)
|
||||||
- [Node - npm](#node---npm)
|
- [Elixir - Mix](#elixir---mix)
|
||||||
- [macOS and Ubuntu](#macos-and-ubuntu)
|
- [Go - Modules](#go---modules)
|
||||||
- [Windows](#windows)
|
- [Linux](#linux-1)
|
||||||
- [Using multiple systems and `npm config`](#using-multiple-systems-and-npm-config)
|
- [macOS](#macos-1)
|
||||||
- [Node - Lerna](#node---lerna)
|
- [Windows](#windows-2)
|
||||||
- [Node - Yarn](#node---yarn)
|
- [Haskell - Cabal](#haskell---cabal)
|
||||||
- [Node - Yarn 2](#node---yarn-2)
|
- [Haskell - Stack](#haskell---stack)
|
||||||
- [OCaml/Reason - esy](#ocamlreason---esy)
|
- [Java - Gradle](#java---gradle)
|
||||||
- [PHP - Composer](#php---composer)
|
- [Java - Maven](#java---maven)
|
||||||
- [Python - pip](#python---pip)
|
- [Node - npm](#node---npm)
|
||||||
- [Simple example](#simple-example)
|
- [macOS and Ubuntu](#macos-and-ubuntu)
|
||||||
- [Multiple OSes in a workflow](#multiple-oss-in-a-workflow)
|
- [Windows](#windows-3)
|
||||||
- [Using pip to get cache location](#using-pip-to-get-cache-location)
|
- [Using multiple systems and `npm config`](#using-multiple-systems-and-npm-config)
|
||||||
- [Using a script to get cache location](#using-a-script-to-get-cache-location)
|
- [Node - Lerna](#node---lerna)
|
||||||
- [R - renv](#r---renv)
|
- [Node - Yarn](#node---yarn)
|
||||||
- [Simple example](#simple-example-1)
|
- [Node - Yarn 2](#node---yarn-2)
|
||||||
- [Multiple OSes in a workflow](#multiple-oss-in-a-workflow-1)
|
- [OCaml/Reason - esy](#ocamlreason---esy)
|
||||||
- [Ruby - Bundler](#ruby---bundler)
|
- [PHP - Composer](#php---composer)
|
||||||
- [Rust - Cargo](#rust---cargo)
|
- [Python - pip](#python---pip)
|
||||||
- [Scala - SBT](#scala---sbt)
|
- [Simple example](#simple-example)
|
||||||
- [Swift, Objective-C - Carthage](#swift-objective-c---carthage)
|
- [Multiple OS's in a workflow](#multiple-oss-in-a-workflow)
|
||||||
- [Swift, Objective-C - CocoaPods](#swift-objective-c---cocoapods)
|
- [Multiple OS's in a workflow with a matrix](#multiple-oss-in-a-workflow-with-a-matrix)
|
||||||
- [Swift - Swift Package Manager](#swift---swift-package-manager)
|
- [Using pip to get cache location](#using-pip-to-get-cache-location)
|
||||||
|
- [Python - pipenv](#python---pipenv)
|
||||||
|
- [R - renv](#r---renv)
|
||||||
|
- [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):
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.nuget/packages
|
path: ~/.nuget/packages
|
||||||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
||||||
@ -45,9 +54,10 @@ Using [NuGet lock files](https://docs.microsoft.com/nuget/consume-packages/packa
|
|||||||
```
|
```
|
||||||
|
|
||||||
Depending on the environment, huge packages might be pre-installed in the global cache folder.
|
Depending on the environment, huge packages might be pre-installed in the global cache folder.
|
||||||
With `actions/cache@v2` you can now exclude unwanted packages with [exclude pattern](https://github.com/actions/toolkit/tree/main/packages/glob#exclude-patterns)
|
With `actions/cache@v3` you can now exclude unwanted packages with [exclude pattern](https://github.com/actions/toolkit/tree/main/packages/glob#exclude-patterns)
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.nuget/packages
|
~/.nuget/packages
|
||||||
@ -59,11 +69,12 @@ With `actions/cache@v2` you can now exclude unwanted packages with [exclude patt
|
|||||||
|
|
||||||
Or you could move the cache folder like below.
|
Or you could move the cache folder like below.
|
||||||
>Note: This workflow does not work for projects that require files to be placed in user profile package folder
|
>Note: This workflow does not work for projects that require files to be placed in user profile package folder
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
env:
|
env:
|
||||||
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
|
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ github.workspace }}/.nuget/packages
|
path: ${{ github.workspace }}/.nuget/packages
|
||||||
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
|
||||||
@ -76,7 +87,7 @@ steps:
|
|||||||
### POSIX
|
### POSIX
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.dub
|
path: ~/.dub
|
||||||
key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
|
key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
|
||||||
@ -87,7 +98,7 @@ steps:
|
|||||||
### Windows
|
### Windows
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~\AppData\Local\dub
|
path: ~\AppData\Local\dub
|
||||||
key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
|
key: ${{ runner.os }}-dub-${{ hashFiles('**/dub.json') }}
|
||||||
@ -95,22 +106,91 @@ steps:
|
|||||||
${{ runner.os }}-dub-
|
${{ runner.os }}-dub-
|
||||||
```
|
```
|
||||||
|
|
||||||
## Elixir - Mix
|
## Deno
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: deps
|
path: |
|
||||||
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
|
~/.deno
|
||||||
|
~/.cache/deno
|
||||||
|
key: ${{ runner.os }}-deno-${{ hashFiles('**/deps.ts') }}
|
||||||
|
```
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/.deno
|
||||||
|
~/Library/Caches/deno
|
||||||
|
key: ${{ runner.os }}-deno-${{ hashFiles('**/deps.ts') }}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~\.deno
|
||||||
|
%LocalAppData%\deno
|
||||||
|
key: ${{ runner.os }}-deno-${{ hashFiles('**/deps.ts') }}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Elixir - Mix
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
deps
|
||||||
|
_build
|
||||||
|
key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-mix-
|
${{ runner.os }}-mix-
|
||||||
```
|
```
|
||||||
|
|
||||||
## Go - Modules
|
## Go - Modules
|
||||||
|
|
||||||
|
### Linux
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/go/pkg/mod
|
path: |
|
||||||
|
~/.cache/go-build
|
||||||
|
~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
```
|
||||||
|
|
||||||
|
### macOS
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~/Library/Caches/go-build
|
||||||
|
~/go/pkg/mod
|
||||||
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-go-
|
||||||
|
```
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
~\AppData\Local\go-build
|
||||||
|
~\go\pkg\mod
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-go-
|
${{ runner.os }}-go-
|
||||||
@ -122,24 +202,46 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
|
- name: Cache ~/.cabal/packages, ~/.cabal/store and dist-newstyle
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cabal/packages
|
~/.cabal/packages
|
||||||
~/.cabal/store
|
~/.cabal/store
|
||||||
dist-newstyle
|
dist-newstyle
|
||||||
key: ${{ runner.os }}-${{ matrix.ghc }}
|
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}
|
||||||
|
restore-keys: ${{ runner.os }}-${{ matrix.ghc }}-
|
||||||
|
```
|
||||||
|
|
||||||
|
## Haskell - Stack
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
name: Cache ~/.stack
|
||||||
|
with:
|
||||||
|
path: ~/.stack
|
||||||
|
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-stack-global-
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
name: Cache .stack-work
|
||||||
|
with:
|
||||||
|
path: .stack-work
|
||||||
|
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('package.yaml') }}-${{ hashFiles('**/*.hs') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-stack-work-
|
||||||
```
|
```
|
||||||
|
|
||||||
## Java - Gradle
|
## Java - Gradle
|
||||||
|
|
||||||
|
>Note: Ensure no Gradle daemons are running anymore when your workflow completes. Creating the cache package might fail due to locks being held by Gradle. Refer to the [Gradle Daemon documentation](https://docs.gradle.org/current/userguide/gradle_daemon.html) on how to disable or stop the Gradle Daemons.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.gradle/caches
|
~/.gradle/caches
|
||||||
~/.gradle/wrapper
|
~/.gradle/wrapper
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-gradle-
|
${{ runner.os }}-gradle-
|
||||||
```
|
```
|
||||||
@ -148,7 +250,7 @@ We cache the elements of the Cabal store separately, as the entirety of `~/.caba
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Cache local Maven repository
|
- name: Cache local Maven repository
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
|
||||||
@ -167,7 +269,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
|
|||||||
### macOS and Ubuntu
|
### macOS and Ubuntu
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.npm
|
path: ~/.npm
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
@ -182,7 +284,7 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
|
|||||||
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@v2
|
- uses: actions/cache@v3
|
||||||
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') }}
|
||||||
@ -194,12 +296,13 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Get npm cache directory
|
- name: Get npm cache directory
|
||||||
id: npm-cache
|
id: npm-cache-dir
|
||||||
run: |
|
run: |
|
||||||
echo "::set-output name=dir::$(npm config get cache)"
|
echo "::set-output name=dir::$(npm config get cache)"
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
|
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.npm-cache.outputs.dir }}
|
path: ${{ steps.npm-cache-dir.outputs.dir }}
|
||||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-node-
|
${{ runner.os }}-node-
|
||||||
@ -209,11 +312,9 @@ If using `npm config` to retrieve the cache directory, ensure you run [actions/s
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: restore lerna
|
- name: restore lerna
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: **/node_modules
|
||||||
node_modules
|
|
||||||
*/*/node_modules
|
|
||||||
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
|
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -225,7 +326,7 @@ The yarn cache directory will depend on your operating system and version of `ya
|
|||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn cache dir)"
|
run: echo "::set-output name=dir::$(yarn cache dir)"
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
@ -234,8 +335,8 @@ The yarn cache directory will depend on your operating system and version of `ya
|
|||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## Node - Yarn 2
|
## Node - Yarn 2
|
||||||
|
|
||||||
The yarn 2 cache directory will depend on your config. See https://yarnpkg.com/configuration/yarnrc#cacheFolder for more info.
|
The yarn 2 cache directory will depend on your config. See https://yarnpkg.com/configuration/yarnrc#cacheFolder for more info.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@ -243,7 +344,7 @@ The yarn 2 cache directory will depend on your config. See https://yarnpkg.com/c
|
|||||||
id: yarn-cache-dir-path
|
id: yarn-cache-dir-path
|
||||||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
||||||
@ -253,11 +354,12 @@ The yarn 2 cache directory will depend on your config. See https://yarnpkg.com/c
|
|||||||
```
|
```
|
||||||
|
|
||||||
## OCaml/Reason - esy
|
## OCaml/Reason - esy
|
||||||
|
|
||||||
Esy allows you to export built dependencies and import pre-built dependencies.
|
Esy allows you to export built dependencies and import pre-built dependencies.
|
||||||
```yaml
|
```yaml
|
||||||
- name: Restore Cache
|
- name: Restore Cache
|
||||||
id: restore-cache
|
id: restore-cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: _export
|
path: _export
|
||||||
key: ${{ runner.os }}-esy-${{ hashFiles('esy.lock/index.json') }}
|
key: ${{ runner.os }}-esy-${{ hashFiles('esy.lock/index.json') }}
|
||||||
@ -279,7 +381,6 @@ Esy allows you to export built dependencies and import pre-built dependencies.
|
|||||||
if: steps.restore-cache.outputs.cache-hit != 'true'
|
if: steps.restore-cache.outputs.cache-hit != 'true'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## PHP - Composer
|
## PHP - Composer
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
@ -287,7 +388,7 @@ Esy allows you to export built dependencies and import pre-built dependencies.
|
|||||||
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@v2
|
- uses: actions/cache@v3
|
||||||
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') }}
|
||||||
@ -300,13 +401,15 @@ Esy allows you to export built dependencies and import pre-built dependencies.
|
|||||||
For pip, the cache directory will vary by OS. See https://pip.pypa.io/en/stable/reference/pip_install/#caching
|
For pip, the cache directory will vary by OS. See https://pip.pypa.io/en/stable/reference/pip_install/#caching
|
||||||
|
|
||||||
Locations:
|
Locations:
|
||||||
- Ubuntu: `~/.cache/pip`
|
|
||||||
- Windows: `~\AppData\Local\pip\Cache`
|
- Ubuntu: `~/.cache/pip`
|
||||||
- macOS: `~/Library/Caches/pip`
|
- Windows: `~\AppData\Local\pip\Cache`
|
||||||
|
- macOS: `~/Library/Caches/pip`
|
||||||
|
|
||||||
### Simple example
|
### Simple example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pip
|
path: ~/.cache/pip
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||||
@ -319,7 +422,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@v2
|
- uses: actions/cache@v3
|
||||||
if: startsWith(runner.os, 'Linux')
|
if: startsWith(runner.os, 'Linux')
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pip
|
path: ~/.cache/pip
|
||||||
@ -327,7 +430,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@v2
|
- uses: actions/cache@v3
|
||||||
if: startsWith(runner.os, 'macOS')
|
if: startsWith(runner.os, 'macOS')
|
||||||
with:
|
with:
|
||||||
path: ~/Library/Caches/pip
|
path: ~/Library/Caches/pip
|
||||||
@ -335,7 +438,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@v2
|
- uses: actions/cache@v3
|
||||||
if: startsWith(runner.os, 'Windows')
|
if: startsWith(runner.os, 'Windows')
|
||||||
with:
|
with:
|
||||||
path: ~\AppData\Local\pip\Cache
|
path: ~\AppData\Local\pip\Cache
|
||||||
@ -344,6 +447,31 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
|
|||||||
${{ runner.os }}-pip-
|
${{ runner.os }}-pip-
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Multiple OS's in a workflow with a matrix
|
||||||
|
|
||||||
|
``` yaml
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||||
|
include:
|
||||||
|
- os: ubuntu-latest
|
||||||
|
path: ~/.cache/pip
|
||||||
|
- os: macos-latest
|
||||||
|
path: ~/Library/Caches/pip
|
||||||
|
- os: windows-latest
|
||||||
|
path: ~\AppData\Local\pip\Cache
|
||||||
|
steps:
|
||||||
|
- uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: ${{ matrix.path }}
|
||||||
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-pip-
|
||||||
|
```
|
||||||
|
|
||||||
### Using pip to get cache location
|
### Using pip to get cache location
|
||||||
|
|
||||||
> Note: This requires pip 20.1+
|
> Note: This requires pip 20.1+
|
||||||
@ -354,7 +482,7 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
|
|||||||
echo "::set-output name=dir::$(pip cache dir)"
|
echo "::set-output name=dir::$(pip cache dir)"
|
||||||
|
|
||||||
- name: pip cache
|
- name: pip cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
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') }}
|
||||||
@ -362,100 +490,77 @@ Replace `~/.cache/pip` with the correct `path` if not using Ubuntu.
|
|||||||
${{ runner.os }}-pip-
|
${{ runner.os }}-pip-
|
||||||
```
|
```
|
||||||
|
|
||||||
### Using a script to get cache location
|
## Python - pipenv
|
||||||
|
|
||||||
> Note: This uses an internal pip API and may not always work
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Get pip cache dir
|
- name: Set up Python
|
||||||
id: pip-cache
|
# The actions/cache step below uses this id to get the exact python version
|
||||||
run: |
|
id: setup-python
|
||||||
python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
|
uses: actions/setup-python@v2
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
⋮
|
||||||
|
|
||||||
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.pip-cache.outputs.dir }}
|
path: ~/.local/share/virtualenvs
|
||||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pipenv-${{ hashFiles('Pipfile.lock') }}
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-pip-
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## R - renv
|
## R - renv
|
||||||
|
|
||||||
For renv, the cache directory will vary by OS. Look at https://rstudio.github.io/renv/articles/renv.html#cache
|
For renv, the cache directory will vary by OS. The `RENV_PATHS_ROOT` environment variable is used to set the cache location. Have a look at https://rstudio.github.io/renv/reference/paths.html#details for more details.
|
||||||
|
|
||||||
Locations:
|
|
||||||
- Ubuntu: `~/.local/share/renv`
|
|
||||||
- macOS: `~/Library/Application Support/renv`
|
|
||||||
- Windows: `%LOCALAPPDATA%/renv`
|
|
||||||
|
|
||||||
### Simple example
|
|
||||||
```yaml
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
with:
|
|
||||||
path: ~/.local/share/renv
|
|
||||||
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-renv-
|
|
||||||
```
|
|
||||||
|
|
||||||
Replace `~/.local/share/renv` with the correct `path` if not using Ubuntu.
|
|
||||||
|
|
||||||
### Multiple OS's in a workflow
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- name: Set RENV_PATHS_ROOT
|
||||||
if: startsWith(runner.os, 'Linux')
|
shell: bash
|
||||||
|
run: |
|
||||||
|
echo "RENV_PATHS_ROOT=${{ runner.temp }}/renv" >> $GITHUB_ENV
|
||||||
|
- name: Install and activate renv
|
||||||
|
run: |
|
||||||
|
install.packages("renv")
|
||||||
|
renv::activate()
|
||||||
|
shell: Rscript {0}
|
||||||
|
- name: Get R and OS version
|
||||||
|
id: get-version
|
||||||
|
run: |
|
||||||
|
cat("##[set-output name=os-version;]", sessionInfo()$running, "\n", sep = "")
|
||||||
|
cat("##[set-output name=r-version;]", R.Version()$version.string, sep = "")
|
||||||
|
shell: Rscript {0}
|
||||||
|
- name: Restore Renv package cache
|
||||||
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: ~/.local/share/renv
|
path: ${{ env.RENV_PATHS_ROOT }}
|
||||||
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
|
key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{ inputs.cache-version }}-${{ hashFiles('renv.lock') }}
|
||||||
restore-keys: |
|
restore-keys: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-
|
||||||
${{ runner.os }}-renv-
|
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
if: startsWith(runner.os, 'macOS')
|
|
||||||
with:
|
|
||||||
path: ~/Library/Application Support/renv
|
|
||||||
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-renv-
|
|
||||||
|
|
||||||
- uses: actions/cache@v2
|
|
||||||
if: startsWith(runner.os, 'Windows')
|
|
||||||
with:
|
|
||||||
path: ~\AppData\Local\renv
|
|
||||||
key: ${{ runner.os }}-renv-${{ hashFiles('**/renv.lock') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-renv-
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Ruby - Bundler
|
## Ruby - Bundler
|
||||||
|
|
||||||
```yaml
|
Caching gems with Bundler correctly is not trivial and just using `actions/cache`
|
||||||
- uses: actions/cache@v2
|
is [not enough](https://github.com/ruby/setup-ruby#caching-bundle-install-manually).
|
||||||
with:
|
|
||||||
path: vendor/bundle
|
Instead, it is recommended to use `ruby/setup-ruby`'s
|
||||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
[`bundler-cache: true` option](https://github.com/ruby/setup-ruby#caching-bundle-install-automatically)
|
||||||
restore-keys: |
|
whenever possible:
|
||||||
${{ runner.os }}-gems-
|
|
||||||
```
|
|
||||||
When dependencies are installed later in the workflow, we must specify the same path for the bundler.
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Bundle install
|
- uses: ruby/setup-ruby@v1
|
||||||
run: |
|
with:
|
||||||
bundle config path vendor/bundle
|
ruby-version: ...
|
||||||
bundle install --jobs 4 --retry 3
|
bundler-cache: true
|
||||||
```
|
```
|
||||||
|
|
||||||
## Rust - Cargo
|
## Rust - Cargo
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.cargo/registry
|
~/.cargo/bin/
|
||||||
~/.cargo/git
|
~/.cargo/registry/index/
|
||||||
target
|
~/.cargo/registry/cache/
|
||||||
|
~/.cargo/git/db/
|
||||||
|
target/
|
||||||
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -463,7 +568,7 @@ When dependencies are installed later in the workflow, we must specify the same
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Cache SBT
|
- name: Cache SBT
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.ivy2/cache
|
~/.ivy2/cache
|
||||||
@ -474,7 +579,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@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: Carthage
|
path: Carthage
|
||||||
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
|
key: ${{ runner.os }}-carthage-${{ hashFiles('**/Cartfile.resolved') }}
|
||||||
@ -485,7 +590,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@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: Pods
|
path: Pods
|
||||||
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
||||||
@ -496,7 +601,7 @@ When dependencies are installed later in the workflow, we must specify the same
|
|||||||
## Swift - Swift Package Manager
|
## Swift - Swift Package Manager
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: actions/cache@v2
|
- uses: actions/cache@v3
|
||||||
with:
|
with:
|
||||||
path: .build
|
path: .build
|
||||||
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
|
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
|
||||||
|
@ -17,7 +17,7 @@ const processStdoutWrite = process.stdout.write.bind(process.stdout);
|
|||||||
process.stdout.write = (str, encoding, cb) => {
|
process.stdout.write = (str, encoding, cb) => {
|
||||||
// Core library will directly call process.stdout.write for commands
|
// Core library will directly call process.stdout.write for commands
|
||||||
// We don't want :: commands to be executed by the runner during tests
|
// We don't want :: commands to be executed by the runner during tests
|
||||||
if (!str.match(/^::/)) {
|
if (!String(str).match(/^::/)) {
|
||||||
return processStdoutWrite(str, encoding, cb);
|
return processStdoutWrite(str, encoding, cb);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
8201
package-lock.json
generated
8201
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
38
package.json
38
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cache",
|
"name": "cache",
|
||||||
"version": "2.1.3",
|
"version": "3.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"description": "Cache dependencies and build outputs",
|
"description": "Cache dependencies and build outputs",
|
||||||
"main": "dist/restore/index.js",
|
"main": "dist/restore/index.js",
|
||||||
@ -23,29 +23,29 @@
|
|||||||
"author": "GitHub",
|
"author": "GitHub",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "^1.0.5",
|
"@actions/cache": "file:../toolkit/packages/cache/actions-cache-1.0.10.tgz",
|
||||||
"@actions/core": "^1.2.6",
|
"@actions/core": "^1.2.6",
|
||||||
"@actions/exec": "^1.0.1",
|
"@actions/exec": "^1.1.1",
|
||||||
"@actions/io": "^1.0.1"
|
"@actions/io": "^1.1.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^24.0.13",
|
"@types/jest": "^27.4.1",
|
||||||
"@types/nock": "^11.1.0",
|
"@types/nock": "^11.1.0",
|
||||||
"@types/node": "^12.0.4",
|
"@types/node": "^16.11.26",
|
||||||
"@typescript-eslint/eslint-plugin": "^2.7.0",
|
"@typescript-eslint/eslint-plugin": "^5.15.0",
|
||||||
"@typescript-eslint/parser": "^2.7.0",
|
"@typescript-eslint/parser": "^5.15.0",
|
||||||
"@zeit/ncc": "^0.20.5",
|
"@zeit/ncc": "^0.20.5",
|
||||||
"eslint": "^6.6.0",
|
"eslint": "^8.11.0",
|
||||||
"eslint-config-prettier": "^6.5.0",
|
"eslint-config-prettier": "^8.5.0",
|
||||||
"eslint-plugin-import": "^2.18.2",
|
"eslint-plugin-import": "^2.25.4",
|
||||||
"eslint-plugin-jest": "^23.0.3",
|
"eslint-plugin-jest": "^26.1.2",
|
||||||
"eslint-plugin-prettier": "^3.1.1",
|
"eslint-plugin-prettier": "^4.0.0",
|
||||||
"eslint-plugin-simple-import-sort": "^5.0.2",
|
"eslint-plugin-simple-import-sort": "^7.0.0",
|
||||||
"jest": "^24.8.0",
|
"jest": "^27.5.1",
|
||||||
"jest-circus": "^24.7.1",
|
"jest-circus": "^27.5.1",
|
||||||
"nock": "^11.7.0",
|
"nock": "^11.7.0",
|
||||||
"prettier": "^1.19.1",
|
"prettier": "^2.6.0",
|
||||||
"ts-jest": "^24.0.2",
|
"ts-jest": "^27.1.3",
|
||||||
"typescript": "^3.7.3"
|
"typescript": "^3.9.9"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,9 @@ import * as utils from "./utils/actionUtils";
|
|||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
if (utils.isGhes()) {
|
if (utils.isGhes()) {
|
||||||
utils.logWarning("Cache action is not supported on GHES");
|
utils.logWarning(
|
||||||
|
"Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
|
||||||
|
);
|
||||||
utils.setCacheHitOutput(false);
|
utils.setCacheHitOutput(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
10
src/save.ts
10
src/save.ts
@ -4,10 +4,17 @@ import * as core from "@actions/core";
|
|||||||
import { Events, Inputs, State } from "./constants";
|
import { Events, Inputs, State } from "./constants";
|
||||||
import * as utils from "./utils/actionUtils";
|
import * as utils from "./utils/actionUtils";
|
||||||
|
|
||||||
|
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
||||||
|
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
|
||||||
|
// throw an uncaught exception. Instead of failing this action, just warn.
|
||||||
|
process.on("uncaughtException", e => utils.logWarning(e.message));
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
if (utils.isGhes()) {
|
if (utils.isGhes()) {
|
||||||
utils.logWarning("Cache action is not supported on GHES");
|
utils.logWarning(
|
||||||
|
"Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,6 +51,7 @@ async function run(): Promise<void> {
|
|||||||
await cache.saveCache(cachePaths, primaryKey, {
|
await cache.saveCache(cachePaths, primaryKey, {
|
||||||
uploadChunkSize: utils.getInputAsInt(Inputs.UploadChunkSize)
|
uploadChunkSize: utils.getInputAsInt(Inputs.UploadChunkSize)
|
||||||
});
|
});
|
||||||
|
core.info(`Cache saved with key: ${primaryKey}`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.name === cache.ValidationError.name) {
|
if (error.name === cache.ValidationError.name) {
|
||||||
throw error;
|
throw error;
|
||||||
|
Loading…
Reference in New Issue
Block a user