Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dd05243424 | ||
|
|
65dbc54a5d | ||
|
|
be7377e68e |
@@ -1,5 +1,14 @@
|
||||
# Changelog
|
||||
|
||||
## 2.5.1
|
||||
|
||||
- Fix hash contribution of `Cargo.lock`.
|
||||
|
||||
## 2.5.0
|
||||
|
||||
- feat: Rm workspace crates version before caching.
|
||||
- feat: Add hash of `.cargo/config.toml` to key.
|
||||
|
||||
## 2.4.0
|
||||
|
||||
- Fix cache key stability.
|
||||
|
||||
21
dist/restore/index.js
vendored
21
dist/restore/index.js
vendored
@@ -64224,7 +64224,7 @@ class CacheConfig {
|
||||
}
|
||||
}
|
||||
}
|
||||
hasher.update(JSON.stringify(sort_object(parsed)));
|
||||
hasher.update(JSON.stringify(parsed));
|
||||
parsedKeyFiles.push(cargo_manifest);
|
||||
}
|
||||
catch (_e) { // Fallback to caching them as regular file
|
||||
@@ -64247,7 +64247,7 @@ class CacheConfig {
|
||||
const packages = parsed.package.filter((p) => {
|
||||
"source" in p || "checksum" in p;
|
||||
});
|
||||
hasher.update(JSON.stringify(sort_object(packages)));
|
||||
hasher.update(JSON.stringify(packages));
|
||||
parsedKeyFiles.push(cargo_lock);
|
||||
}
|
||||
catch (_e) { // Fallback to caching them as regular file
|
||||
@@ -64387,23 +64387,6 @@ function sort_and_uniq(a) {
|
||||
return accumulator;
|
||||
}, []);
|
||||
}
|
||||
function sort_object(o) {
|
||||
if (Array.isArray(o)) {
|
||||
return o.sort().map(sort_object);
|
||||
}
|
||||
else if (typeof o === 'object' && o != null) {
|
||||
return Object
|
||||
.keys(o)
|
||||
.sort()
|
||||
.reduce(function (a, k) {
|
||||
a[k] = sort_object(o[k]);
|
||||
return a;
|
||||
}, {});
|
||||
}
|
||||
else {
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./src/cleanup.ts
|
||||
|
||||
|
||||
21
dist/save/index.js
vendored
21
dist/save/index.js
vendored
@@ -64224,7 +64224,7 @@ class CacheConfig {
|
||||
}
|
||||
}
|
||||
}
|
||||
hasher.update(JSON.stringify(sort_object(parsed)));
|
||||
hasher.update(JSON.stringify(parsed));
|
||||
parsedKeyFiles.push(cargo_manifest);
|
||||
}
|
||||
catch (_e) { // Fallback to caching them as regular file
|
||||
@@ -64247,7 +64247,7 @@ class CacheConfig {
|
||||
const packages = parsed.package.filter((p) => {
|
||||
"source" in p || "checksum" in p;
|
||||
});
|
||||
hasher.update(JSON.stringify(sort_object(packages)));
|
||||
hasher.update(JSON.stringify(packages));
|
||||
parsedKeyFiles.push(cargo_lock);
|
||||
}
|
||||
catch (_e) { // Fallback to caching them as regular file
|
||||
@@ -64387,23 +64387,6 @@ function sort_and_uniq(a) {
|
||||
return accumulator;
|
||||
}, []);
|
||||
}
|
||||
function sort_object(o) {
|
||||
if (Array.isArray(o)) {
|
||||
return o.sort().map(sort_object);
|
||||
}
|
||||
else if (typeof o === 'object' && o != null) {
|
||||
return Object
|
||||
.keys(o)
|
||||
.sort()
|
||||
.reduce(function (a, k) {
|
||||
a[k] = sort_object(o[k]);
|
||||
return a;
|
||||
}, {});
|
||||
}
|
||||
else {
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
||||
;// CONCATENATED MODULE: ./src/cleanup.ts
|
||||
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "rust-cache",
|
||||
"version": "2.5.0",
|
||||
"version": "2.5.1",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "rust-cache",
|
||||
"version": "2.5.0",
|
||||
"version": "2.5.1",
|
||||
"license": "LGPL-3.0",
|
||||
"dependencies": {
|
||||
"@actions/cache": "^3.2.1",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "rust-cache",
|
||||
"version": "2.5.0",
|
||||
"version": "2.5.1",
|
||||
"description": "A GitHub Action that implements smart caching for rust/cargo projects with sensible defaults.",
|
||||
"keywords": [
|
||||
"actions",
|
||||
|
||||
@@ -172,7 +172,7 @@ export class CacheConfig {
|
||||
}
|
||||
}
|
||||
|
||||
hasher.update(JSON.stringify(sort_object(parsed)));
|
||||
hasher.update(JSON.stringify(parsed));
|
||||
|
||||
parsedKeyFiles.push(cargo_manifest);
|
||||
} catch (_e) { // Fallback to caching them as regular file
|
||||
@@ -200,7 +200,7 @@ export class CacheConfig {
|
||||
"source" in p || "checksum" in p
|
||||
});
|
||||
|
||||
hasher.update(JSON.stringify(sort_object(packages)));
|
||||
hasher.update(JSON.stringify(packages));
|
||||
|
||||
parsedKeyFiles.push(cargo_lock);
|
||||
} catch (_e) { // Fallback to caching them as regular file
|
||||
@@ -367,20 +367,3 @@ function sort_and_uniq(a: string[]) {
|
||||
[]
|
||||
);
|
||||
}
|
||||
|
||||
function sort_object(o: any): any {
|
||||
if (Array.isArray(o)) {
|
||||
return o.sort().map(sort_object);
|
||||
} else if (typeof o === 'object' && o != null) {
|
||||
return Object
|
||||
.keys(o)
|
||||
.sort()
|
||||
.reduce(function(a: any, k) {
|
||||
a[k] = sort_object(o[k]);
|
||||
|
||||
return a;
|
||||
}, {});
|
||||
} else {
|
||||
return o;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user