mirror of
https://github.com/actions/setup-node.git
synced 2026-02-21 06:05:56 +08:00
Compare commits
1 Commits
81ed0cdc6a
...
v4.2.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1d0ff469b7 |
4
.licenses/npm/@fastify/busboy.dep.yml
generated
4
.licenses/npm/@fastify/busboy.dep.yml
generated
@@ -1,9 +1,9 @@
|
|||||||
---
|
---
|
||||||
name: "@fastify/busboy"
|
name: "@fastify/busboy"
|
||||||
version: 2.0.0
|
version: 2.1.1
|
||||||
type: npm
|
type: npm
|
||||||
summary: A streaming parser for HTML form data for node.js
|
summary: A streaming parser for HTML form data for node.js
|
||||||
homepage:
|
homepage:
|
||||||
license: mit
|
license: mit
|
||||||
licenses:
|
licenses:
|
||||||
- sources: LICENSE
|
- sources: LICENSE
|
||||||
|
|||||||
2
.licenses/npm/undici.dep.yml
generated
2
.licenses/npm/undici.dep.yml
generated
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: undici
|
name: undici
|
||||||
version: 5.28.4
|
version: 5.28.5
|
||||||
type: npm
|
type: npm
|
||||||
summary: An HTTP/1.1 client, written from scratch for Node.js
|
summary: An HTTP/1.1 client, written from scratch for Node.js
|
||||||
homepage: https://undici.nodejs.org
|
homepage: https://undici.nodejs.org
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ describe('cache-restore', () => {
|
|||||||
it.each([['npm7'], ['npm6'], ['pnpm6'], ['yarn1'], ['yarn2'], ['random']])(
|
it.each([['npm7'], ['npm6'], ['pnpm6'], ['yarn1'], ['yarn2'], ['random']])(
|
||||||
'Throw an error because %s is not supported',
|
'Throw an error because %s is not supported',
|
||||||
async packageManager => {
|
async packageManager => {
|
||||||
await expect(restoreCache(packageManager, '', '')).rejects.toThrow(
|
await expect(restoreCache(packageManager, '')).rejects.toThrow(
|
||||||
`Caching for '${packageManager}' is not supported`
|
`Caching for '${packageManager}' is not supported`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -124,13 +124,13 @@ describe('cache-restore', () => {
|
|||||||
|
|
||||||
describe('Restore dependencies', () => {
|
describe('Restore dependencies', () => {
|
||||||
it.each([
|
it.each([
|
||||||
['yarn', '2.1.2', yarnFileHash, '22'],
|
['yarn', '2.1.2', yarnFileHash],
|
||||||
['yarn', '1.2.3', yarnFileHash, '20.17'],
|
['yarn', '1.2.3', yarnFileHash],
|
||||||
['npm', '', npmFileHash, '22.12'],
|
['npm', '', npmFileHash],
|
||||||
['pnpm', '', pnpmFileHash, '18']
|
['pnpm', '', pnpmFileHash]
|
||||||
])(
|
])(
|
||||||
'restored dependencies for %s',
|
'restored dependencies for %s',
|
||||||
async (packageManager, toolVersion, fileHash, nodeVersion) => {
|
async (packageManager, toolVersion, fileHash) => {
|
||||||
getCommandOutputSpy.mockImplementation((command: string) => {
|
getCommandOutputSpy.mockImplementation((command: string) => {
|
||||||
if (command.includes('version')) {
|
if (command.includes('version')) {
|
||||||
return toolVersion;
|
return toolVersion;
|
||||||
@@ -139,10 +139,10 @@ describe('cache-restore', () => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await restoreCache(packageManager, '', nodeVersion);
|
await restoreCache(packageManager, '');
|
||||||
expect(hashFilesSpy).toHaveBeenCalled();
|
expect(hashFilesSpy).toHaveBeenCalled();
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
expect(infoSpy).toHaveBeenCalledWith(
|
||||||
`Cache restored from key: node-cache-${platform}-${arch}-${nodeVersion}-${packageManager}-${fileHash}`
|
`Cache restored from key: node-cache-${platform}-${arch}-${packageManager}-${fileHash}`
|
||||||
);
|
);
|
||||||
expect(infoSpy).not.toHaveBeenCalledWith(
|
expect(infoSpy).not.toHaveBeenCalledWith(
|
||||||
`${packageManager} cache is not found`
|
`${packageManager} cache is not found`
|
||||||
@@ -170,7 +170,7 @@ describe('cache-restore', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
restoreCacheSpy.mockImplementationOnce(() => undefined);
|
restoreCacheSpy.mockImplementationOnce(() => undefined);
|
||||||
await restoreCache(packageManager, '', '');
|
await restoreCache(packageManager, '');
|
||||||
expect(hashFilesSpy).toHaveBeenCalled();
|
expect(hashFilesSpy).toHaveBeenCalled();
|
||||||
expect(infoSpy).toHaveBeenCalledWith(
|
expect(infoSpy).toHaveBeenCalledWith(
|
||||||
`${packageManager} cache is not found`
|
`${packageManager} cache is not found`
|
||||||
|
|||||||
3075
dist/cache-save/index.js
vendored
3075
dist/cache-save/index.js
vendored
File diff suppressed because it is too large
Load Diff
3081
dist/setup/index.js
vendored
3081
dist/setup/index.js
vendored
File diff suppressed because it is too large
Load Diff
14
package-lock.json
generated
14
package-lock.json
generated
@@ -1061,9 +1061,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@fastify/busboy": {
|
"node_modules/@fastify/busboy": {
|
||||||
"version": "2.0.0",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz",
|
||||||
"integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==",
|
"integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==",
|
||||||
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=14"
|
||||||
}
|
}
|
||||||
@@ -5584,9 +5585,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/undici": {
|
"node_modules/undici": {
|
||||||
"version": "5.28.4",
|
"version": "5.28.5",
|
||||||
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz",
|
"resolved": "https://registry.npmjs.org/undici/-/undici-5.28.5.tgz",
|
||||||
"integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==",
|
"integrity": "sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fastify/busboy": "^2.0.0"
|
"@fastify/busboy": "^2.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ import {
|
|||||||
|
|
||||||
export const restoreCache = async (
|
export const restoreCache = async (
|
||||||
packageManager: string,
|
packageManager: string,
|
||||||
cacheDependencyPath: string,
|
cacheDependencyPath: string
|
||||||
nodeVersion: string
|
|
||||||
) => {
|
) => {
|
||||||
const packageManagerInfo = await getPackageManagerInfo(packageManager);
|
const packageManagerInfo = await getPackageManagerInfo(packageManager);
|
||||||
if (!packageManagerInfo) {
|
if (!packageManagerInfo) {
|
||||||
@@ -41,7 +40,7 @@ export const restoreCache = async (
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const keyPrefix = `node-cache-${platform}-${arch}-${nodeVersion}-${packageManager}`;
|
const keyPrefix = `node-cache-${platform}-${arch}-${packageManager}`;
|
||||||
const primaryKey = `${keyPrefix}-${fileHash}`;
|
const primaryKey = `${keyPrefix}-${fileHash}`;
|
||||||
core.debug(`primary key is ${primaryKey}`);
|
core.debug(`primary key is ${primaryKey}`);
|
||||||
|
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export async function run() {
|
|||||||
if (cache && isCacheFeatureAvailable()) {
|
if (cache && isCacheFeatureAvailable()) {
|
||||||
core.saveState(State.CachePackageManager, cache);
|
core.saveState(State.CachePackageManager, cache);
|
||||||
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
const cacheDependencyPath = core.getInput('cache-dependency-path');
|
||||||
await restoreCache(cache, cacheDependencyPath, version);
|
await restoreCache(cache, cacheDependencyPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
const matchersPath = path.join(__dirname, '../..', '.github');
|
const matchersPath = path.join(__dirname, '../..', '.github');
|
||||||
|
|||||||
Reference in New Issue
Block a user