Compare commits

...

48 Commits

Author SHA1 Message Date
938abf1ecf review comment 2022-09-15 08:30:00 +00:00
e09283e3aa format 2022-09-15 05:39:59 +00:00
3c1fd3e58a changed the error message 2022-09-15 05:20:02 +00:00
1bc650b06c Merge pull request #922 from actions/vsvipul/add-anurag
Add anuragc617 to assignees
2022-09-14 15:00:13 +05:30
92e01f4797 Add anuragc617 to assignees 2022-09-14 09:27:02 +00:00
b195c997a4 Merge pull request #912 from actions/pdotl/readme-update-1
Update README to include zstd workaround for windows.
2022-08-30 14:38:09 +05:30
9f98a2f01c Merge branch 'main' into pdotl/readme-update-1 2022-08-30 14:02:27 +05:30
471fb0c87e Move workarounds to a different file 2022-08-30 08:24:10 +00:00
a213d1e898 Merge pull request #913 from actions/vsvipul-patch-2
Add a note about path expansion on Windows.
2022-08-29 17:21:30 +05:30
0c180092a2 Add a note about path expansion on Windows. 2022-08-29 17:16:27 +05:30
c38f55d874 Merge branch 'main' into pdotl/readme-update-1 2022-08-29 11:10:51 +05:30
2865f2c28c Merge pull request #911 from actions/vsvipul-patch-1
Remove .md files skip condition from test workflow
2022-08-29 11:09:50 +05:30
f52a12d355 Merge remote-tracking branch 'refs/remotes/origin/pdotl/readme-update-1' into pdotl/readme-update-1 2022-08-26 09:01:04 +00:00
a057257949 Add cross-os caching to the zstd workaround section. 2022-08-26 09:00:35 +00:00
d1124f7857 Merge branch 'main' into pdotl/readme-update-1 2022-08-25 18:54:53 +05:30
7b5e3aaf23 Move remaining section of Cache segment restore timeout 2022-08-25 13:18:15 +00:00
eb8b610ee6 Add zstd workaround to README. Add yaml formatting to code blocks. Move Cache segment restore to Known Practices section. 2022-08-25 13:14:23 +00:00
27c0af5532 Remove .md files skip condition from test workflow 2022-08-25 16:52:00 +05:30
7e7820edca Move Cache segment restore timeout to Known practices and workarounds 2022-08-25 05:52:10 +00:00
6c9470d12d Merge pull request #910 from actions/vsvipul/add-reviewers
Add pallavx and pdotl to reviewers
2022-08-25 10:04:28 +05:30
a59a2347a7 Add pallavx and pdotl to reviewers 2022-08-25 03:55:46 +00:00
d785f8b8a2 Merge pull request #908 from actions/vsvipul/fix-dep
Update @actions/core to 1.9.1
2022-08-24 17:10:07 +05:30
81423d07fe Update licenses 2022-08-24 11:32:31 +00:00
c1dbd4593f Update @actions/core to 1.9.1 2022-08-24 11:26:37 +00:00
5f975d03e6 Merge pull request #896 from actions/bishal-pdMSFT-patch-1
Add readme section for good practices
2022-08-23 16:33:03 +05:30
8a9a57869f Update README.md 2022-08-23 15:20:27 +05:30
fb1d96e3ff Update README.md 2022-08-23 13:19:05 +05:30
2048ecfa86 Merge pull request #903 from actions/vsvipul/sort-inputs
Sort inputs and remove whitespaces after exclamation
2022-08-22 21:19:36 +05:30
8954b07458 Removed unnecessary backslash in regex 2022-08-22 13:05:20 +00:00
0ae6818675 Formatted files with prettier 2022-08-22 12:57:35 +00:00
f316f94f31 Generate build and fix format 2022-08-22 12:45:18 +00:00
204fa1ab69 Sort inputs and remove whitespaces after exclamation at the beginning of lines 2022-08-22 12:42:01 +00:00
fd5de65bc8 Merge pull request #899 from actions/kotewar/download-and-compression-fix
Updated actions/cache toolkit dep to v3.0.4
2022-08-22 12:07:42 +05:30
d49b6bb21d Updated actions/cache toolkit dep to v3.0.4 2022-08-18 14:13:31 +00:00
23d218be27 Add section for good practices 2022-08-14 14:35:33 +05:30
a7c34adf76 Merge pull request #894 from actions/kotewar/update-toolkit-version
Fix for the download stuck problem
2022-08-11 14:56:44 +05:30
83394c99b7 Updated cache version in license file 2022-08-11 07:59:07 +00:00
e839c25979 Updated actions/cache version to 3.0.3 2022-08-11 07:57:29 +00:00
33a923d660 Added release information 2022-08-09 16:48:03 +00:00
a404368986 Updated actions/cache version to 3.0.2 2022-08-09 16:43:43 +00:00
f4278025ab Merge pull request #887 from actions/pdotl-version-patch
Update toolkit's cache npm module to latest. Bump cache version to v3.0.6
2022-08-05 12:38:26 +05:30
9916fe1701 Update cache version in licences 2022-08-04 10:46:56 +00:00
318935ef66 Update README and RELEASES 2022-08-04 10:37:56 +00:00
85efbb58b9 Update cache npm module to latest 2022-08-04 10:00:08 +00:00
4387dbc81a Merge pull request #835 from shivamarora1/clojure-lein-example
feat: 🎸 add example for clojure lein project deps
2022-08-01 13:27:13 +05:30
71e3ee5cce Add phantsure to PR reviewers 2022-07-28 00:10:09 +05:30
c316eb7911 Add phantsure to issue assignment 2022-07-28 00:09:39 +05:30
a0e530f115 feat: 🎸 add example for clojure lein project deps
In Clojure, Lein tool is used to generate template for various projects.
Lein project metadata (including project dependencies) are stored in
prject.clj (in root directory) file. Lein downloads dependencies in
classpath (~/.m2/repository). So here I am caching ~/.m2/repository path
for reusing cache in subsequent builds.
2022-06-26 00:39:24 +05:30
17 changed files with 4171 additions and 3916 deletions

View File

@ -6,6 +6,10 @@ addAssignees: false
# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
- anuragc617
- pallavx
- pdotl
- phantsure
- kotewar
- aparna-ravindra
- tiwarishub

View File

@ -11,5 +11,5 @@ jobs:
- name: 'Auto-assign issue'
uses: pozil/auto-assign-issue@v1.4.0
with:
assignees: kotewar,tiwarishub,aparna-ravindra,vsvipul,bishal-pdmsft
assignees: anuragc617,pallavx,pdotl,phantsure,kotewar,tiwarishub,aparna-ravindra,vsvipul,bishal-pdmsft
numOfAssignee: 1

View File

@ -5,14 +5,10 @@ on:
branches:
- main
- releases/**
paths-ignore:
- '**.md'
push:
branches:
- main
- releases/**
paths-ignore:
- '**.md'
jobs:
# Build and unit test

View File

@ -1,20 +1,20 @@
---
name: "@actions/cache"
version: 3.0.0
version: 3.0.4
type: npm
summary:
homepage:
summary:
homepage:
license: mit
licenses:
- sources: LICENSE.md
text: |-
The MIT License (MIT)
- sources: LICENSE.md
text: |-
The MIT License (MIT)
Copyright 2019 GitHub
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
notices: []

View File

@ -1,6 +1,6 @@
---
name: "@actions/core"
version: 1.7.0
version: 1.9.1
type: npm
summary: Actions core lib
homepage: https://github.com/actions/toolkit/tree/main/packages/core

View File

@ -1,9 +1,9 @@
---
name: "@actions/http-client"
version: 1.0.11
version: 2.0.1
type: npm
summary: Actions Http Client
homepage: https://github.com/actions/http-client#readme
homepage: https://github.com/actions/toolkit/tree/main/packages/http-client
license: mit
licenses:
- sources: LICENSE

View File

@ -15,6 +15,11 @@ See ["Caching dependencies to speed up workflows"](https://help.github.com/githu
* Updated the minimum runner version support from node 12 -> node 16.
* Fixed avoiding empty cache save when no files are available for caching.
* Fixed tar creation error while trying to create tar with path as `~/` home folder on `ubuntu-latest`.
* Fixed zstd failing on amazon linux 2.0 runners.
* Fixed cache not working with github workspace directory or current directory.
* Fixed the download stuck problem by introducing a timeout of 1 hour for cache downloads.
* Fix zstd not working for windows on gnu tar in issues.
* Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable `SEGMENT_DOWNLOAD_TIMEOUT_MIN`. Default is 60 minutes.
Refer [here](https://github.com/actions/cache/blob/v2/README.md) for previous versions
@ -32,6 +37,9 @@ If you are using this inside a container, a POSIX-compliant `tar` needs to be in
* `restore-keys` - An ordered list of keys to use for restoring stale cache if no cache hit occurred for key. Note
`cache-hit` returns false in this case.
#### Environment Variables
* `SEGMENT_DOWNLOAD_TIMEOUT_MIN` - Segment download timeout (in minutes, default `60`) to abort download of the segment if not completed in the defined number of minutes. [Read more](#cache-segment-restore-timeout)
### Outputs
* `cache-hit` - A boolean value to indicate an exact match was found for the key
@ -81,6 +89,7 @@ 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:
- [C# - NuGet](./examples.md#c---nuget)
- [Clojure - Lein Deps](./examples.md#clojure---lein-deps)
- [D - DUB](./examples.md#d---dub)
- [Deno](./examples.md#deno)
- [Elixir - Mix](./examples.md#elixir---mix)
@ -215,6 +224,17 @@ jobs:
run: ./generate-primes -d prime-numbers
```
## Known practices and workarounds
Following are some of the known practices/workarounds which community has used to fulfill specific requirements. You may choose to use them if suits your use case. Note these are not necessarily the only or the recommended solution.
- [Cache segment restore timeout](./workarounds.md#cache-segment-restore-timeout)
- [Update a cache](./workarounds.md#update-a-cache)
- [Use cache across feature branches](./workarounds.md#use-cache-across-feature-branches)
- [Improving cache restore performance on Windows/Using cross-os caching](./workarounds.md#improving-cache-restore-performance-on-windows-using-cross-os-caching)
#### Windows environment variables
Please note that Windows environment variables (like `%LocalAppData%`) will NOT be expanded by this action. Instead, prefer using `~` in your paths which will expand to HOME directory. For example, instead of `%LocalAppData%`, use `~\AppData\Local`. For a list of supported default environment variables, see [this](https://docs.github.com/en/actions/learn-github-actions/environment-variables) page.
## 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.

View File

@ -17,4 +17,15 @@
- Fixed tar creation error while trying to create tar with path as `~/` home folder on `ubuntu-latest`. ([issue](https://github.com/actions/cache/issues/689))
### 3.0.5
- Removed error handling by consuming actions/cache 3.0 toolkit, Now cache server error handling will be done by toolkit. ([PR](https://github.com/actions/cache/pull/834))
- Removed error handling by consuming actions/cache 3.0 toolkit, Now cache server error handling will be done by toolkit. ([PR](https://github.com/actions/cache/pull/834))
### 3.0.6
- Fixed [#809](https://github.com/actions/cache/issues/809) - zstd -d: no such file or directory error
- Fixed [#833](https://github.com/actions/cache/issues/833) - cache doesn't work with github workspace directory
### 3.0.7
- Fixed [#810](https://github.com/actions/cache/issues/810) - download stuck issue. A new timeout is introduced in the download process to abort the download if it gets stuck and doesn't finish within an hour.
### 3.0.8
- Fix zstd not working for windows on gnu tar in issues [#888](https://github.com/actions/cache/issues/888) and [#891](https://github.com/actions/cache/issues/891).
- Allowing users to provide a custom timeout as input for aborting download of a cache segment using an environment variable `SEGMENT_DOWNLOAD_TIMEOUT_MIN`. Default is 60 minutes.

View File

@ -215,6 +215,39 @@ test("getInputAsArray handles empty lines correctly", () => {
expect(actionUtils.getInputAsArray("foo")).toEqual(["bar", "baz"]);
});
test("getInputAsArray sorts files correctly", () => {
testUtils.setInput(
"foo",
"bar\n!baz\nwaldo\nqux\nquux\ncorge\ngrault\ngarply"
);
expect(actionUtils.getInputAsArray("foo")).toEqual([
"!baz",
"bar",
"corge",
"garply",
"grault",
"quux",
"qux",
"waldo"
]);
});
test("getInputAsArray removes spaces after ! at the beginning", () => {
testUtils.setInput(
"foo",
"! bar\n! baz\n! qux\n!quux\ncorge\ngrault! garply\n!\r\t waldo"
);
expect(actionUtils.getInputAsArray("foo")).toEqual([
"!bar",
"!baz",
"!quux",
"!qux",
"!waldo",
"corge",
"grault! garply"
]);
});
test("getInputAsInt returns undefined if input not set", () => {
expect(actionUtils.getInputAsInt("undefined")).toBeUndefined();
});
@ -244,8 +277,8 @@ test("isCacheFeatureAvailable for ac enabled", () => {
test("isCacheFeatureAvailable for ac disabled on GHES", () => {
jest.spyOn(cache, "isFeatureAvailable").mockImplementation(() => false);
const message =
"Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.";
const message = `Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.
Otherwise please upgrade to GHES version >= 3.5 and If you are also using Github Connect, please unretire the actions/cache namespace before upgrade (see https://docs.github.com/en/enterprise-server@3.5/admin/github-actions/managing-access-to-actions-from-githubcom/enabling-automatic-access-to-githubcom-actions-using-github-connect#automatic-retirement-of-namespaces-for-actions-accessed-on-githubcom)`;
const infoMock = jest.spyOn(core, "info");
try {

View File

@ -147,7 +147,7 @@ test("restore with no key", async () => {
test("restore with too many keys should fail", async () => {
const path = "node_modules";
const key = "node-test";
const restoreKeys = [...Array(20).keys()].map(x => x.toString());
const restoreKeys = [...Array(20).keys()].map(x => x.toString()).sort();
testUtils.setInputs({
path: path,
key,

3913
dist/restore/index.js vendored

File diff suppressed because it is too large Load Diff

3913
dist/save/index.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,7 @@
# Examples
- [C# - NuGet](#c---nuget)
- [Clojure - Lein Deps](#clojure---lein-deps)
- [D - DUB](#d---dub)
- [POSIX](#posix)
- [Windows](#windows)
@ -80,6 +81,19 @@ steps:
${{ runner.os }}-nuget-
```
## Clojure - Lein Deps
```yaml
- name: Cache lein project dependencies
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-clojure-${{ hashFiles('**/project.clj') }}
restore-keys: |
${{ runner.os }}-clojure
```
## D - DUB
### POSIX

85
package-lock.json generated
View File

@ -1,16 +1,16 @@
{
"name": "cache",
"version": "3.0.5",
"version": "3.0.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "cache",
"version": "3.0.5",
"version": "3.0.8",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.0.0",
"@actions/core": "^1.7.0",
"@actions/cache": "^3.0.4",
"@actions/core": "^1.9.1",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2"
},
@ -36,9 +36,9 @@
}
},
"node_modules/@actions/cache": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.0.tgz",
"integrity": "sha512-GL9CT1Fnu+pqs8TTB621q8Xa8Cilw2n9MwvbgMedetH7L1q2n6jY61gzbwGbKgtVbp3gVJ12aNMi4osSGXx3KQ==",
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.4.tgz",
"integrity": "sha512-9RwVL8/ISJoYWFNH1wR/C26E+M3HDkGPWmbFJMMCKwTkjbNZJreMT4XaR/EB1bheIvN4PREQxEQQVJ18IPnf/Q==",
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.1",
@ -51,20 +51,21 @@
"uuid": "^3.3.3"
}
},
"node_modules/@actions/cache/node_modules/@actions/http-client": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"node_modules/@actions/core": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
"dependencies": {
"tunnel": "^0.0.6"
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
}
},
"node_modules/@actions/core": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.7.0.tgz",
"integrity": "sha512-7fPSS7yKOhTpgLMbw7lBLc1QJWvJBBAgyTX2PEhagWcKK8t0H8AKCoPMfnrHqIm5cRYH4QFPqD1/ruhuUE7YcQ==",
"dependencies": {
"@actions/http-client": "^1.0.11"
"node_modules/@actions/core/node_modules/uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/@actions/exec": {
@ -85,11 +86,11 @@
}
},
"node_modules/@actions/http-client": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"dependencies": {
"tunnel": "0.0.6"
"tunnel": "^0.0.6"
}
},
"node_modules/@actions/io": {
@ -9533,9 +9534,9 @@
},
"dependencies": {
"@actions/cache": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.0.tgz",
"integrity": "sha512-GL9CT1Fnu+pqs8TTB621q8Xa8Cilw2n9MwvbgMedetH7L1q2n6jY61gzbwGbKgtVbp3gVJ12aNMi4osSGXx3KQ==",
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.0.4.tgz",
"integrity": "sha512-9RwVL8/ISJoYWFNH1wR/C26E+M3HDkGPWmbFJMMCKwTkjbNZJreMT4XaR/EB1bheIvN4PREQxEQQVJ18IPnf/Q==",
"requires": {
"@actions/core": "^1.2.6",
"@actions/exec": "^1.0.1",
@ -9546,24 +9547,22 @@
"@azure/storage-blob": "^12.8.0",
"semver": "^6.1.0",
"uuid": "^3.3.3"
},
"dependencies": {
"@actions/http-client": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"requires": {
"tunnel": "^0.0.6"
}
}
}
},
"@actions/core": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.7.0.tgz",
"integrity": "sha512-7fPSS7yKOhTpgLMbw7lBLc1QJWvJBBAgyTX2PEhagWcKK8t0H8AKCoPMfnrHqIm5cRYH4QFPqD1/ruhuUE7YcQ==",
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
"requires": {
"@actions/http-client": "^1.0.11"
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
},
"dependencies": {
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
}
}
},
"@actions/exec": {
@ -9584,11 +9583,11 @@
}
},
"@actions/http-client": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz",
"integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"requires": {
"tunnel": "0.0.6"
"tunnel": "^0.0.6"
}
},
"@actions/io": {

View File

@ -1,6 +1,6 @@
{
"name": "cache",
"version": "3.0.5",
"version": "3.0.8",
"private": true,
"description": "Cache dependencies and build outputs",
"main": "dist/restore/index.js",
@ -23,8 +23,8 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.0.0",
"@actions/core": "^1.7.0",
"@actions/cache": "^3.0.4",
"@actions/core": "^1.9.1",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2"
},
@ -48,4 +48,4 @@
"ts-jest": "^28.0.2",
"typescript": "^4.6.4"
}
}
}

View File

@ -61,8 +61,9 @@ export function getInputAsArray(
return core
.getInput(name, options)
.split("\n")
.map(s => s.trim())
.filter(x => x !== "");
.map(s => s.replace(/^!\s+/, "!").trim())
.filter(x => x !== "")
.sort();
}
export function getInputAsInt(
@ -80,7 +81,8 @@ export function isCacheFeatureAvailable(): boolean {
if (!cache.isFeatureAvailable()) {
if (isGhes()) {
logWarning(
"Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not."
`Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.
Otherwise please upgrade to GHES version >= 3.5 and If you are also using Github Connect, please unretire the actions/cache namespace before upgrade (see https://docs.github.com/en/enterprise-server@3.5/admin/github-actions/managing-access-to-actions-from-githubcom/enabling-automatic-access-to-githubcom-actions-using-github-connect#automatic-retirement-of-namespaces-for-actions-accessed-on-githubcom)`
);
} else {
logWarning(

38
workarounds.md Normal file
View File

@ -0,0 +1,38 @@
#### Cache segment restore timeout
A cache gets downloaded in multiple segments of fixed sizes (`1GB` for a `32-bit` runner and `2GB` for a `64-bit` runner). Sometimes, a segment download gets stuck which causes the workflow job to be stuck forever and fail. Version `v3.0.8` of `actions/cache` introduces a segment download timeout. The segment download timeout will allow the segment download to get aborted and hence allow the job to proceed with a cache miss.
Default value of this timeout is 60 minutes and can be customized by specifying an [environment variable](https://docs.github.com/en/actions/learn-github-actions/environment-variables) named `SEGMENT_DOWNLOAD_TIMEOUT_MINS` with timeout value in minutes.
#### Update a cache
A cache today is immutable and cannot be updated. But some use cases require the cache to be saved even though there was a "hit" during restore. To do so, use a `key` which is unique for every run and use `restore-keys` to restore the nearest cache. For example:
```yaml
- name: update cache on every commit
uses: actions/cache@v3
with:
path: prime-numbers
key: primes-${{ runner.os }}-${{ github.run_id }} # Can use time based key as well
restore-keys: |
primes-${{ runner.os }}
```
Please note that this will create a new cache on every run and hence will consume the cache [quota](#cache-limits).
#### Use cache across feature branches
Reusing cache across feature branches is not allowed today to provide cache [isolation](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache). However if both feature branches are from the default branch, a good way to achieve this is to ensure that the default branch has a cache. This cache will then be consumable by both feature branches.
#### Improving cache restore performance on Windows/Using cross-os caching
Currently, cache restore is slow on Windows due to tar being inherently slow and the compression algorithm `gzip` in use. `zstd` is the default algorithm in use on linux and macos. It was disabled on Windows due to issues with bsd tar(libarchive), the tar implementation in use on Windows.
To improve cache restore performance, we can re-enable `zstd` as the compression algorithm using the following workaround. Add the following step to your workflow before the cache step:
```yaml
- if: ${{ runner.os == 'Windows' }}
name: Use GNU tar
shell: cmd
run: |
echo "Adding GNU tar to PATH"
echo C:\Program Files\Git\usr\bin>>"%GITHUB_PATH%"
```
The `cache` action will use GNU tar instead of bsd tar on Windows. This should work on all Github Hosted runners as it is. For self-hosted runners, please ensure you have GNU tar and `zstd` installed.
The above workaround is also needed if you wish to use cross-os caching since difference of compression algorithms will result in different cache versions for the same cache key. So the above workaround will ensure `zstd` is used for caching on all platforms thus resulting in the same cache version for the same cache key.