3
0
Fork 0
mirror of https://github.com/Swatinem/rust-cache synced 2026-07-07 15:26:19 +00:00

Fix Windows cache path validation after Rollup migration (#355)

This commit is contained in:
eitsupi 2026-07-04 17:11:26 +09:00 committed by GitHub
parent 6dfd3c5062
commit a31add9f17
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 297 additions and 2398 deletions

70
.github/workflows/save-restore.yml vendored Normal file
View file

@ -0,0 +1,70 @@
name: save-restore
on: [push, pull_request]
permissions: {}
jobs:
save:
if: github.repository == 'Swatinem/rust-cache'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: Save a new cache on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --no-self-update
# Use a per-run key so this job always exercises the post-step save path.
- uses: ./
with:
workspaces: tests
shared-key: save-restore-${{ matrix.os }}-${{ github.run_id }}-${{ github.run_attempt }}
- run: cargo check
working-directory: tests
restore:
if: github.repository == 'Swatinem/rust-cache'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
name: Restore the newly saved cache on ${{ matrix.os }}
needs: save
runs-on: ${{ matrix.os }}
env:
CARGO_TERM_COLOR: always
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
persist-credentials: false
- run: rustup toolchain install stable --profile minimal --no-self-update
- id: cache
uses: ./
with:
workspaces: tests
shared-key: save-restore-${{ matrix.os }}-${{ github.run_id }}-${{ github.run_attempt }}
save-if: "false"
- name: Verify exact cache hit
if: steps.cache.outputs.cache-hit != 'true'
shell: bash
run: |
echo "The cache created by the save job could not be restored." >&2
exit 1

View file

@ -1,4 +1,4 @@
import { v as commonjsGlobal, x as requireTunnel, m as getDefaultExportFromCjs, y as getAugmentedNamespace } from './cleanup-Dr5MZ8bz.js';
import { v as commonjsGlobal, x as requireTunnel, y as getDefaultExportFromCjs, z as getAugmentedNamespace } from './cleanup-BnmJoqJp.js';
import os__default from 'os';
import crypto__default from 'crypto';
import fs__default from 'fs';
@ -28,8 +28,8 @@ import require$$6$1 from 'string_decoder';
import require$$0$a from 'diagnostics_channel';
import require$$2__default$1 from 'child_process';
import require$$6$2 from 'timers';
import { r as requireConcatMap, a as requireDist$4, e as requireSrc$d, b as requireDist$5, c as requireState$2, d as requireStateCjs } from './state-cjs-BbR-w6pp.js';
import require$$0$b from 'punycode';
import { r as requireDist$4, d as requireSrc$d, a as requireDist$5, b as requireState$2, c as requireStateCjs } from './state-cjs-DNYNk0pO.js';
import process$1 from 'node:process';
import require$$6$3 from 'http2';
import os from 'node:os';
@ -27391,6 +27391,28 @@ function requireInternalPatternHelper () {
var internalPattern = {};
var concatMap;
var hasRequiredConcatMap;
function requireConcatMap () {
if (hasRequiredConcatMap) return concatMap;
hasRequiredConcatMap = 1;
concatMap = function (xs, fn) {
var res = [];
for (var i = 0; i < xs.length; i++) {
var x = fn(xs[i], i);
if (isArray(x)) res.push.apply(res, x);
else res.push(x);
}
return res;
};
var isArray = Array.isArray || function (xs) {
return Object.prototype.toString.call(xs) === '[object Array]';
};
return concatMap;
}
var balancedMatch;
var hasRequiredBalancedMatch;

File diff suppressed because it is too large Load diff

View file

@ -34145,10 +34145,10 @@ async function getCacheProvider() {
let cache;
switch (cacheProvider) {
case "github":
cache = await import('./cache-983zFS-E.js');
cache = await import('./cache-oK5XC6-w.js');
break;
case "warpbuild":
cache = await import('./cache-WmUk0Jib.js').then(function (n) { return n.c; });
cache = await import('./cache-COXGx-w3.js').then(function (n) { return n.c; });
break;
default:
throw new Error(`The \`cache-provider\` \`${cacheProvider}\` is not valid.`);
@ -34855,4 +34855,4 @@ async function rmRF(dirName) {
await rmRF$1(dirName);
}
export { BearerCredentialHandler as B, CacheConfig as C, HttpCodes as H, getInput as a, exportVariable as b, cleanTargetDir as c, isCacheUpToDate as d, error as e, debug as f, getCacheProvider as g, cleanRegistry as h, info as i, cleanBin as j, cleanGit as k, exec as l, getDefaultExportFromCjs as m, mkdirP as n, warning as o, HttpClientError as p, HttpClient as q, reportError as r, setOutput as s, isDebug as t, setSecret as u, commonjsGlobal as v, which as w, requireTunnel as x, getAugmentedNamespace as y };
export { BearerCredentialHandler as B, CacheConfig as C, HttpCodes as H, getInput as a, exportVariable as b, cleanTargetDir as c, isCacheUpToDate as d, error as e, debug as f, getCacheProvider as g, cleanRegistry as h, info as i, cleanBin as j, cleanGit as k, exec as l, mkdirP as m, create as n, warning as o, HttpClientError as p, HttpClient as q, reportError as r, setOutput as s, isDebug as t, setSecret as u, commonjsGlobal as v, which as w, requireTunnel as x, getDefaultExportFromCjs as y, getAugmentedNamespace as z };

2
dist/restore.js vendored
View file

@ -1,4 +1,4 @@
import { e as error, g as getCacheProvider, a as getInput, b as exportVariable, C as CacheConfig, i as info, c as cleanTargetDir, r as reportError, s as setOutput } from './cleanup-Dr5MZ8bz.js';
import { e as error, g as getCacheProvider, a as getInput, b as exportVariable, C as CacheConfig, i as info, c as cleanTargetDir, r as reportError, s as setOutput } from './cleanup-BnmJoqJp.js';
import 'os';
import 'crypto';
import 'fs';

2
dist/save.js vendored
View file

@ -1,4 +1,4 @@
import { e as error, g as getCacheProvider, a as getInput, d as isCacheUpToDate, i as info, C as CacheConfig, c as cleanTargetDir, f as debug, h as cleanRegistry, j as cleanBin, k as cleanGit, r as reportError, l as exec } from './cleanup-Dr5MZ8bz.js';
import { e as error, g as getCacheProvider, a as getInput, d as isCacheUpToDate, i as info, C as CacheConfig, c as cleanTargetDir, f as debug, h as cleanRegistry, j as cleanBin, k as cleanGit, r as reportError, l as exec } from './cleanup-BnmJoqJp.js';
import 'os';
import 'crypto';
import 'fs';

View file

@ -8,28 +8,6 @@ import require$$0__default$1 from 'events';
import require$$2__default from 'http';
import require$$1__default from 'https';
var concatMap;
var hasRequiredConcatMap;
function requireConcatMap () {
if (hasRequiredConcatMap) return concatMap;
hasRequiredConcatMap = 1;
concatMap = function (xs, fn) {
var res = [];
for (var i = 0; i < xs.length; i++) {
var x = fn(xs[i], i);
if (isArray(x)) res.push.apply(res, x);
else res.push(x);
}
return res;
};
var isArray = Array.isArray || function (xs) {
return Object.prototype.toString.call(xs) === '[object Array]';
};
return concatMap;
}
var dist$2 = {};
var src = {exports: {}};
@ -1844,4 +1822,4 @@ function requireStateCjs () {
return stateCjs;
}
export { requireDist$1 as a, requireDist as b, requireState as c, requireStateCjs as d, requireSrc as e, requireConcatMap as r };
export { requireDist as a, requireState as b, requireStateCjs as c, requireSrc as d, requireDist$1 as r };

40
package-lock.json generated
View file

@ -38,7 +38,7 @@
"dependencies": {
"@actions/core": "^3.0.1",
"@actions/exec": "^3.0.0",
"@actions/glob": "^0.6.1",
"@actions/glob": "^0.7.0",
"@actions/http-client": "^4.0.1",
"@actions/io": "^3.0.2",
"@azure/core-rest-pipeline": "^1.23.0",
@ -47,44 +47,6 @@
"semver": "^7.7.4"
}
},
"node_modules/@actions/cache/node_modules/@actions/glob": {
"version": "0.6.1",
"resolved": "https://registry.npmjs.org/@actions/glob/-/glob-0.6.1.tgz",
"integrity": "sha512-K4+2Ac5ILcf2ySdJCha+Pop9NcKjxqCL4xL4zI50dgB2PbXgC0+AcP011xfH4Of6b4QEJJg8dyZYv7zl4byTsw==",
"license": "MIT",
"dependencies": {
"@actions/core": "^3.0.0",
"minimatch": "^3.0.4"
}
},
"node_modules/@actions/cache/node_modules/balanced-match": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
"license": "MIT"
},
"node_modules/@actions/cache/node_modules/brace-expansion": {
"version": "1.1.15",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.15.tgz",
"integrity": "sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg==",
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
}
},
"node_modules/@actions/cache/node_modules/minimatch": {
"version": "3.1.5",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.5.tgz",
"integrity": "sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w==",
"license": "ISC",
"dependencies": {
"brace-expansion": "^1.1.7"
},
"engines": {
"node": "*"
}
},
"node_modules/@actions/core": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-3.0.1.tgz",

View file

@ -31,6 +31,11 @@
"@actions/warpbuild-cache": "npm:github-actions.warp-cache@1.4.7",
"smol-toml": "^1.7.0"
},
"overrides": {
"@actions/cache": {
"@actions/glob": "$@actions/glob"
}
},
"devDependencies": {
"@rollup/plugin-commonjs": "^29.0.3",
"@rollup/plugin-json": "^6.1.0",