Compare commits

..

15 Commits

Author SHA1 Message Date
Bassem Dghaidi
67b144e17c Add backend ids 2024-06-24 01:16:26 -07:00
Bassem Dghaidi
ae82de5d80 Add fix cache paths 2024-06-17 03:35:51 -07:00
Bassem Dghaidi
92c0d581d5 Add more debug info 2024-06-17 02:58:38 -07:00
Bassem Dghaidi
15ed468872 Fix cache save 2024-06-17 02:39:15 -07:00
Bassem Dghaidi
2fbb473cf9 Fix cache misses 2024-06-17 02:35:05 -07:00
Bassem Dghaidi
d8dede30d8 Fix cache service url bug 2024-06-17 01:32:58 -07:00
Bassem Dghaidi
313eb59159 Add downloads v2 2024-06-17 01:17:28 -07:00
Bassem Dghaidi
07e50f1839 Use zlib for compression 2024-06-13 03:18:21 -07:00
Bassem Dghaidi
b4b70a7f57 Implement cache v2 2024-06-10 12:13:36 -07:00
Bassem Dghaidi
b88a5b44f3 Implement cache v2 2024-06-10 12:02:34 -07:00
Bassem Dghaidi
643d6d6123 Implement cache v2 2024-06-10 11:37:36 -07:00
Bassem Dghaidi
f7e6edf3a0 Implement cache v2 2024-06-10 11:07:49 -07:00
Bassem Dghaidi
270eaa9768 Add twirp client 2024-05-29 06:29:41 -07:00
Bassem Dghaidi
a2aae2e903 Add warning 2024-05-23 09:22:18 -07:00
Bassem Dghaidi
2c0830523b test 2024-05-23 09:16:10 -07:00
13 changed files with 267619 additions and 16943 deletions

View File

@@ -54,7 +54,7 @@ If you are using a `self-hosted` Windows runner, `GNU tar` and `zstd` are requir
* `key` - An explicit key for a cache entry. See [creating a cache key](#creating-a-cache-key).
* `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.
* `restore-keys` - An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key.
* `restore-keys` - An ordered list of prefix-matched keys to use for restoring stale cache if no cache hit occurred for key.
* `enableCrossOsArchive` - An optional boolean when enabled, allows Windows runners to save or restore caches that can be restored or saved respectively on other platforms. Default: `false`
* `fail-on-cache-miss` - Fail the workflow if cache entry is not found. Default: `false`
* `lookup-only` - If true, only checks if cache entry exists and skips download. Does not change save cache behavior. Default: `false`
@@ -91,7 +91,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Cache Primes
id: cache-primes
@@ -122,7 +122,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Restore cached Primes
id: cache-primes-restore
@@ -229,7 +229,7 @@ Example:
```yaml
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- uses: actions/cache@v4
id: cache
@@ -259,7 +259,7 @@ jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Cache Primes
id: cache-primes
@@ -286,7 +286,7 @@ jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v3
- name: Cache Primes
id: cache-primes

View File

@@ -260,7 +260,7 @@ test("Fail restore when fail on cache miss is enabled and primary + restore keys
);
expect(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(0);
expect(failedMock).toHaveBeenCalledWith(
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${key}`

View File

@@ -86,8 +86,7 @@ test("restore with no cache found", async () => {
);
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
expect(outputMock).toHaveBeenCalledWith("cache-hit", "false");
expect(outputMock).toHaveBeenCalledTimes(2);
expect(outputMock).toHaveBeenCalledTimes(1);
expect(failedMock).toHaveBeenCalledTimes(0);
expect(infoMock).toHaveBeenCalledWith(

View File

@@ -9,7 +9,7 @@ inputs:
description: 'An explicit key for restoring and saving the cache'
required: true
restore-keys:
description: 'An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case.'
description: '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.'
required: false
upload-chunk-size:
description: 'The chunk size used to split up large files during upload, in bytes'

File diff suppressed because one or more lines are too long

70888
dist/restore/index.js vendored

File diff suppressed because one or more lines are too long

70887
dist/save-only/index.js vendored

File diff suppressed because one or more lines are too long

70887
dist/save/index.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -513,7 +513,6 @@ jobs:
```yaml
- name: Get pip cache dir
id: pip-cache
shell: bash
run: |
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT

980
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -23,10 +23,10 @@
"author": "GitHub",
"license": "MIT",
"dependencies": {
"@actions/cache": "^3.2.3",
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/io": "^1.1.2"
"@actions/cache": "file:/workspaces/toolkit/packages/cache",
"@actions/core": "file:/workspaces/toolkit/packages/core",
"@actions/exec": "file:/workspaces/toolkit/packages/exec",
"@actions/io": "file:/workspaces/toolkit/packages/io"
},
"devDependencies": {
"@types/jest": "^27.5.2",

View File

@@ -9,7 +9,7 @@ inputs:
description: 'An explicit key for restoring the cache'
required: true
restore-keys:
description: 'An ordered multiline string listing the prefix-matched keys, that are used for restoring stale cache if no cache hit occurred for key. Note `cache-hit` returns false in this case.'
description: '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.'
required: false
enableCrossOsArchive:
description: 'An optional boolean when enabled, allows windows runners to restore caches that were saved on other platforms'

View File

@@ -51,7 +51,6 @@ export async function restoreImpl(
);
if (!cacheKey) {
core.setOutput(Outputs.CacheHit, false.toString());
if (failOnCacheMiss) {
throw new Error(
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`
@@ -63,6 +62,7 @@ export async function restoreImpl(
...restoreKeys
].join(", ")}`
);
return;
}