mirror of
https://gitea.com/actions/cache.git
synced 2025-11-10 03:06:28 +08:00
Compare commits
15 Commits
f6dab89c74
...
Link-/blob
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
67b144e17c | ||
|
|
ae82de5d80 | ||
|
|
92c0d581d5 | ||
|
|
15ed468872 | ||
|
|
2fbb473cf9 | ||
|
|
d8dede30d8 | ||
|
|
313eb59159 | ||
|
|
07e50f1839 | ||
|
|
b4b70a7f57 | ||
|
|
b88a5b44f3 | ||
|
|
643d6d6123 | ||
|
|
f7e6edf3a0 | ||
|
|
270eaa9768 | ||
|
|
a2aae2e903 | ||
|
|
2c0830523b |
10
README.md
10
README.md
@@ -91,7 +91,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Cache Primes
|
- name: Cache Primes
|
||||||
id: cache-primes
|
id: cache-primes
|
||||||
@@ -122,7 +122,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Restore cached Primes
|
- name: Restore cached Primes
|
||||||
id: cache-primes-restore
|
id: cache-primes-restore
|
||||||
@@ -229,7 +229,7 @@ Example:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- uses: actions/cache@v4
|
- uses: actions/cache@v4
|
||||||
id: cache
|
id: cache
|
||||||
@@ -259,7 +259,7 @@ jobs:
|
|||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Cache Primes
|
- name: Cache Primes
|
||||||
id: cache-primes
|
id: cache-primes
|
||||||
@@ -286,7 +286,7 @@ jobs:
|
|||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Cache Primes
|
- name: Cache Primes
|
||||||
id: cache-primes
|
id: cache-primes
|
||||||
|
|||||||
@@ -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(stateMock).toHaveBeenCalledWith("CACHE_KEY", key);
|
||||||
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
|
expect(setCacheHitOutputMock).toHaveBeenCalledTimes(0);
|
||||||
|
|
||||||
expect(failedMock).toHaveBeenCalledWith(
|
expect(failedMock).toHaveBeenCalledWith(
|
||||||
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${key}`
|
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${key}`
|
||||||
|
|||||||
@@ -86,8 +86,7 @@ test("restore with no cache found", async () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
expect(outputMock).toHaveBeenCalledWith("cache-primary-key", key);
|
||||||
expect(outputMock).toHaveBeenCalledWith("cache-hit", "false");
|
expect(outputMock).toHaveBeenCalledTimes(1);
|
||||||
expect(outputMock).toHaveBeenCalledTimes(2);
|
|
||||||
expect(failedMock).toHaveBeenCalledTimes(0);
|
expect(failedMock).toHaveBeenCalledTimes(0);
|
||||||
|
|
||||||
expect(infoMock).toHaveBeenCalledWith(
|
expect(infoMock).toHaveBeenCalledWith(
|
||||||
|
|||||||
31236
dist/restore-only/index.js
vendored
31236
dist/restore-only/index.js
vendored
File diff suppressed because one or more lines are too long
31236
dist/restore/index.js
vendored
31236
dist/restore/index.js
vendored
File diff suppressed because one or more lines are too long
31235
dist/save-only/index.js
vendored
31235
dist/save-only/index.js
vendored
File diff suppressed because one or more lines are too long
31235
dist/save/index.js
vendored
31235
dist/save/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -513,7 +513,6 @@ jobs:
|
|||||||
```yaml
|
```yaml
|
||||||
- name: Get pip cache dir
|
- name: Get pip cache dir
|
||||||
id: pip-cache
|
id: pip-cache
|
||||||
shell: bash
|
|
||||||
run: |
|
run: |
|
||||||
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
|
echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
|||||||
50
package-lock.json
generated
50
package-lock.json
generated
@@ -10,9 +10,9 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "file:/workspaces/toolkit/packages/cache",
|
"@actions/cache": "file:/workspaces/toolkit/packages/cache",
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "file:/workspaces/toolkit/packages/core",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "file:/workspaces/toolkit/packages/exec",
|
||||||
"@actions/io": "^1.1.2"
|
"@actions/io": "file:/workspaces/toolkit/packages/io"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.5.2",
|
"@types/jest": "^27.5.2",
|
||||||
@@ -35,6 +35,41 @@
|
|||||||
"typescript": "^4.9.3"
|
"typescript": "^4.9.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"../toolkit": {
|
||||||
|
"name": "root",
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/artifact": "^2.1.7",
|
||||||
|
"@actions/attest": "^1.2.1",
|
||||||
|
"@actions/cache": "^3.2.4",
|
||||||
|
"@actions/core": "^1.10.1",
|
||||||
|
"@actions/exec": "^1.1.1",
|
||||||
|
"@actions/github": "^6.0.0",
|
||||||
|
"@actions/glob": "^0.4.0",
|
||||||
|
"@actions/http-client": "^2.2.1",
|
||||||
|
"@actions/io": "^1.1.3",
|
||||||
|
"@actions/tool-cache": "^2.0.1",
|
||||||
|
"tunnel": "^0.0.6",
|
||||||
|
"undici": "^6.18.1"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/jest": "^29.5.4",
|
||||||
|
"@types/node": "^20.5.7",
|
||||||
|
"@types/signale": "^1.4.1",
|
||||||
|
"concurrently": "^6.1.0",
|
||||||
|
"eslint": "^8.0.1",
|
||||||
|
"eslint-config-prettier": "^8.9.0",
|
||||||
|
"eslint-plugin-github": "^4.9.2",
|
||||||
|
"eslint-plugin-jest": "^27.2.3",
|
||||||
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
|
"flow-bin": "^0.115.0",
|
||||||
|
"jest": "^29.6.4",
|
||||||
|
"lerna": "^6.4.1",
|
||||||
|
"nx": "16.6.0",
|
||||||
|
"prettier": "^3.0.0",
|
||||||
|
"ts-jest": "^29.1.1",
|
||||||
|
"typescript": "^5.2.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"../toolkit/packages/cache": {
|
"../toolkit/packages/cache": {
|
||||||
"name": "@actions/cache",
|
"name": "@actions/cache",
|
||||||
"version": "3.2.4",
|
"version": "3.2.4",
|
||||||
@@ -72,6 +107,12 @@
|
|||||||
"@types/uuid": "^8.3.4"
|
"@types/uuid": "^8.3.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"../toolkit/packages/core/src": {
|
||||||
|
"extraneous": true
|
||||||
|
},
|
||||||
|
"../toolkit/packages/core/src/lib": {
|
||||||
|
"extraneous": true
|
||||||
|
},
|
||||||
"../toolkit/packages/exec": {
|
"../toolkit/packages/exec": {
|
||||||
"name": "@actions/exec",
|
"name": "@actions/exec",
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
@@ -85,6 +126,9 @@
|
|||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"../workspaces/toolkit": {
|
||||||
|
"extraneous": true
|
||||||
|
},
|
||||||
"node_modules/@actions/cache": {
|
"node_modules/@actions/cache": {
|
||||||
"resolved": "../toolkit/packages/cache",
|
"resolved": "../toolkit/packages/cache",
|
||||||
"link": true
|
"link": true
|
||||||
|
|||||||
@@ -24,9 +24,9 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/cache": "file:/workspaces/toolkit/packages/cache",
|
"@actions/cache": "file:/workspaces/toolkit/packages/cache",
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "file:/workspaces/toolkit/packages/core",
|
||||||
"@actions/exec": "^1.1.1",
|
"@actions/exec": "file:/workspaces/toolkit/packages/exec",
|
||||||
"@actions/io": "^1.1.2"
|
"@actions/io": "file:/workspaces/toolkit/packages/io"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/jest": "^27.5.2",
|
"@types/jest": "^27.5.2",
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ export async function restoreImpl(
|
|||||||
// Validate inputs, this can cause task failure
|
// Validate inputs, this can cause task failure
|
||||||
if (!utils.isValidEvent()) {
|
if (!utils.isValidEvent()) {
|
||||||
utils.logWarning(
|
utils.logWarning(
|
||||||
`Event Validation Error: The event type ${process.env[Events.Key]
|
`Event Validation Error: The event type ${
|
||||||
|
process.env[Events.Key]
|
||||||
} is not supported because it's not tied to a branch or tag ref.`
|
} is not supported because it's not tied to a branch or tag ref.`
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@@ -50,7 +51,6 @@ export async function restoreImpl(
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (!cacheKey) {
|
if (!cacheKey) {
|
||||||
core.setOutput(Outputs.CacheHit, false.toString());
|
|
||||||
if (failOnCacheMiss) {
|
if (failOnCacheMiss) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`
|
`Failed to restore cache entry. Exiting as fail-on-cache-miss is set. Input key: ${primaryKey}`
|
||||||
@@ -62,6 +62,7 @@ export async function restoreImpl(
|
|||||||
...restoreKeys
|
...restoreKeys
|
||||||
].join(", ")}`
|
].join(", ")}`
|
||||||
);
|
);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user