From d9aab2aba42682d8d25f49f0be491c3e8d56ccdb Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Tue, 13 Jul 2021 16:28:09 +0300 Subject: [PATCH 1/9] dra --- docs/adrs/0000-caching-dependencies.md | 2 +- ...0001-support-caching-deps-for-monorepos.md | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 docs/adrs/0001-support-caching-deps-for-monorepos.md diff --git a/docs/adrs/0000-caching-dependencies.md b/docs/adrs/0000-caching-dependencies.md index 99a6932..c862a8d 100644 --- a/docs/adrs/0000-caching-dependencies.md +++ b/docs/adrs/0000-caching-dependencies.md @@ -1,7 +1,7 @@ # 0. Caching dependencies Date: 2021-05-21 -Status: Proposed +Status: Accepted # Context `actions/setup-node` is the 2nd most popular action in GitHub Actions. A lot of customers use it in conjunction with [actions/cache](https://github.com/actions/cache) to speed up dependencies installation. diff --git a/docs/adrs/0001-support-caching-deps-for-monorepos.md b/docs/adrs/0001-support-caching-deps-for-monorepos.md new file mode 100644 index 0000000..98167ec --- /dev/null +++ b/docs/adrs/0001-support-caching-deps-for-monorepos.md @@ -0,0 +1,48 @@ +# 0. Support caching dependencies for mono repos +Date: 2021-07-13 + +Status: Proposed + +## Context +Currently, `actions/setup-node` supports caching dependencies for Npm and Yarn package managers. +For the first iteration, we have decided to not support cases where `package-lock.json` / `yarn.lock` are located outside of repository root. +Current implementation searches the following file patterns in the repository root: `package-lock.json`, `yarn.lock` (in order of resolving priorities) + +Obviosly, it made build-in caching unusable for mono-repos and repos with complex structure. +We would like to revisit this decision and add customization for dependencies lock file location. + +## Proposal +We have the following options: +1. Allow to specify directory where `package-lock.json` or `yarn.lock` are located +2. Allow to specify path to the dependencies lock file (including directory path and filename) + +The second option looks more generic because it allows to: +- specify multiple dependencies files using file patterns like `**/package-lock.json` ([one of recommended approaches in actions/cache](https://github.com/actions/cache/blob/main/examples.md#macos-and-ubuntu)) +- specify custom dependencies files like `src/npm-shrinkwrap.json` +- change default resolving priority if both `yarn.lock` and `package-lock.json` exist in repository + +## Decision + +Add `deps-lock-file` input that will accept path (relative to repository root) to dependencies lock file. +If path provided path contains wildcards, the action will search all maching files and calculate common hash like `${{ hashFiles('**/packages.lock.json') }}` YAML construction does. +The hash of privided matched files will be used as a part of cache key. + +Yaml examples: +```yml +steps: +- uses: actions/checkout@v2 +- uses: actions/setup-node@v2 + with: + node-version: 14 + cache: npm + deps-lock-file: 'sub-project/package-lock.json' +``` +```yml +steps: +- uses: actions/checkout@v2 +- uses: actions/setup-node@v2 + with: + node-version: 14 + cache: yarn + deps-lock-file: 'sub-project/**/yarn.lock' +``` \ No newline at end of file From 5aa72c249a47160b814e62b58a7d20910c1cec29 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Tue, 13 Jul 2021 19:36:58 +0300 Subject: [PATCH 2/9] Apply suggestions from code review Co-authored-by: Alena Sviridenko --- docs/adrs/0001-support-caching-deps-for-monorepos.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/adrs/0001-support-caching-deps-for-monorepos.md b/docs/adrs/0001-support-caching-deps-for-monorepos.md index 98167ec..c147864 100644 --- a/docs/adrs/0001-support-caching-deps-for-monorepos.md +++ b/docs/adrs/0001-support-caching-deps-for-monorepos.md @@ -8,7 +8,7 @@ Currently, `actions/setup-node` supports caching dependencies for Npm and Yarn p For the first iteration, we have decided to not support cases where `package-lock.json` / `yarn.lock` are located outside of repository root. Current implementation searches the following file patterns in the repository root: `package-lock.json`, `yarn.lock` (in order of resolving priorities) -Obviosly, it made build-in caching unusable for mono-repos and repos with complex structure. +Obviously, it made build-in caching unusable for mono-repos and repos with complex structure. We would like to revisit this decision and add customization for dependencies lock file location. ## Proposal @@ -24,8 +24,8 @@ The second option looks more generic because it allows to: ## Decision Add `deps-lock-file` input that will accept path (relative to repository root) to dependencies lock file. -If path provided path contains wildcards, the action will search all maching files and calculate common hash like `${{ hashFiles('**/packages.lock.json') }}` YAML construction does. -The hash of privided matched files will be used as a part of cache key. +If provided path contains wildcards, the action will search all maching files and calculate common hash like `${{ hashFiles('**/packages.lock.json') }}` YAML construction does. +The hash of provided matched files will be used as a part of cache key. Yaml examples: ```yml @@ -45,4 +45,4 @@ steps: node-version: 14 cache: yarn deps-lock-file: 'sub-project/**/yarn.lock' -``` \ No newline at end of file +``` From 3c1fbef7d3e6be825fd4c4d2dc8fecd28d42df04 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Tue, 13 Jul 2021 20:35:24 +0300 Subject: [PATCH 3/9] Update 0001-support-caching-deps-for-monorepos.md --- docs/adrs/0001-support-caching-deps-for-monorepos.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/adrs/0001-support-caching-deps-for-monorepos.md b/docs/adrs/0001-support-caching-deps-for-monorepos.md index c147864..923e189 100644 --- a/docs/adrs/0001-support-caching-deps-for-monorepos.md +++ b/docs/adrs/0001-support-caching-deps-for-monorepos.md @@ -23,8 +23,8 @@ The second option looks more generic because it allows to: ## Decision -Add `deps-lock-file` input that will accept path (relative to repository root) to dependencies lock file. -If provided path contains wildcards, the action will search all maching files and calculate common hash like `${{ hashFiles('**/packages.lock.json') }}` YAML construction does. +Add `package-lock-file` input that will accept path (relative to repository root) to dependencies lock file. +If provided path contains wildcards, the action will search all maching files and calculate common hash like `${{ hashFiles('**/package-lock.json') }}` YAML construction does. The hash of provided matched files will be used as a part of cache key. Yaml examples: @@ -35,7 +35,7 @@ steps: with: node-version: 14 cache: npm - deps-lock-file: 'sub-project/package-lock.json' + package-lock-file: 'sub-project/package-lock.json' ``` ```yml steps: @@ -44,5 +44,5 @@ steps: with: node-version: 14 cache: yarn - deps-lock-file: 'sub-project/**/yarn.lock' + package-lock-file: 'sub-project/**/yarn.lock' ``` From f43d8a1f27404e4f3fe2c5c1832c5e4e066bad96 Mon Sep 17 00:00:00 2001 From: Maxim Lobanov Date: Thu, 15 Jul 2021 13:23:09 +0300 Subject: [PATCH 4/9] Update 0001-support-caching-deps-for-monorepos.md --- docs/adrs/0001-support-caching-deps-for-monorepos.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/adrs/0001-support-caching-deps-for-monorepos.md b/docs/adrs/0001-support-caching-deps-for-monorepos.md index 923e189..0677873 100644 --- a/docs/adrs/0001-support-caching-deps-for-monorepos.md +++ b/docs/adrs/0001-support-caching-deps-for-monorepos.md @@ -23,7 +23,7 @@ The second option looks more generic because it allows to: ## Decision -Add `package-lock-file` input that will accept path (relative to repository root) to dependencies lock file. +Add `cache-dependency-path` input that will accept path (relative to repository root) to dependencies lock file. If provided path contains wildcards, the action will search all maching files and calculate common hash like `${{ hashFiles('**/package-lock.json') }}` YAML construction does. The hash of provided matched files will be used as a part of cache key. @@ -35,7 +35,7 @@ steps: with: node-version: 14 cache: npm - package-lock-file: 'sub-project/package-lock.json' + cache-dependency-path: 'sub-project/package-lock.json' ``` ```yml steps: @@ -44,5 +44,5 @@ steps: with: node-version: 14 cache: yarn - package-lock-file: 'sub-project/**/yarn.lock' + cache-dependency-path: 'sub-project/**/yarn.lock' ``` From 004fb83876b9004324d616562b9d39f637f9aabc Mon Sep 17 00:00:00 2001 From: AlyonaSviridenko Date: Tue, 3 Aug 2021 18:33:25 +0300 Subject: [PATCH 5/9] Temporarily disabled cache usage --- __tests__/installer.test.ts | 21 ++++++++++++++------- dist/setup/index.js | 9 ++++----- src/installer.ts | 3 ++- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index 9948923..85cf264 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -171,7 +171,8 @@ describe('setup-node', () => { // Found in cache tests //-------------------------------------------------- - it('finds version in cache with stable true', async () => { + // Usage of pre-cached Node.js versions is temporarily disabled. + xit('finds version in cache with stable true', async () => { inputs['node-version'] = '12'; inputs.stable = 'true'; @@ -182,7 +183,8 @@ describe('setup-node', () => { expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`); }); - it('finds version in cache with stable not supplied', async () => { + // Usage of pre-cached Node.js versions is temporarily disabled. + xit('finds version in cache with stable not supplied', async () => { inputs['node-version'] = '12'; inSpy.mockImplementation(name => inputs[name]); @@ -194,7 +196,8 @@ describe('setup-node', () => { expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`); }); - it('finds version in cache and adds it to the path', async () => { + // Usage of pre-cached Node.js versions is temporarily disabled. + xit('finds version in cache and adds it to the path', async () => { inputs['node-version'] = '12'; inSpy.mockImplementation(name => inputs[name]); @@ -384,7 +387,8 @@ describe('setup-node', () => { }, 100000); describe('check-latest flag', () => { - it('use local version and dont check manifest if check-latest is not specified', async () => { + // Usage of pre-cached Node.js versions is temporarily disabled. + xit('use local version and dont check manifest if check-latest is not specified', async () => { os.platform = 'linux'; os.arch = 'x64'; @@ -405,7 +409,8 @@ describe('setup-node', () => { ); }); - it('check latest version and resolve it from local cache', async () => { + // Usage of pre-cached Node.js versions is temporarily disabled. + xit('check latest version and resolve it from local cache', async () => { os.platform = 'linux'; os.arch = 'x64'; @@ -556,7 +561,8 @@ describe('setup-node', () => { inputs.stable = 'true'; }); - it('find latest LTS version and resolve it from local cache (lts/erbium)', async () => { + // Usage of pre-cached Node.js versions is temporarily disabled. + xit('find latest LTS version and resolve it from local cache (lts/erbium)', async () => { // arrange inputs['node-version'] = 'lts/erbium'; @@ -626,7 +632,8 @@ describe('setup-node', () => { ); }); - it('find latest LTS version and resolve it from local cache (lts/*)', async () => { + // Usage of pre-cached Node.js versions is temporarily disabled. + xit('find latest LTS version and resolve it from local cache (lts/*)', async () => { // arrange inputs['node-version'] = 'lts/*'; diff --git a/dist/setup/index.js b/dist/setup/index.js index 1a21370..44aa68f 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -8761,7 +8761,7 @@ module.exports = require("timers"); /* 215 */ /***/ (function(module) { -module.exports = {"name":"@octokit/rest","version":"16.38.1","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^3.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^16.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:code":"node scripts/update-endpoints/code","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.38.1.tgz","_integrity":"sha512-zyNFx+/Bd1EXt7LQjfrc6H4wryBQ/oDuZeZhGMBSFr1eMPFDmpEweFQR3R25zjKwBQpDY7L5GQO6A3XSaOfV1w==","_from":"@octokit/rest@16.38.1"}; +module.exports = {"_args":[["@octokit/rest@16.38.1","/Users/user/Documents/AppCenter/setup-node-actions"]],"_from":"@octokit/rest@16.38.1","_id":"@octokit/rest@16.38.1","_inBundle":false,"_integrity":"sha512-zyNFx+/Bd1EXt7LQjfrc6H4wryBQ/oDuZeZhGMBSFr1eMPFDmpEweFQR3R25zjKwBQpDY7L5GQO6A3XSaOfV1w==","_location":"/@octokit/rest","_phantomChildren":{"os-name":"3.1.0"},"_requested":{"type":"version","registry":true,"raw":"@octokit/rest@16.38.1","name":"@octokit/rest","escapedName":"@octokit%2frest","scope":"@octokit","rawSpec":"16.38.1","saveSpec":null,"fetchSpec":"16.38.1"},"_requiredBy":["/@actions/github"],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.38.1.tgz","_spec":"16.38.1","_where":"/Users/user/Documents/AppCenter/setup-node-actions","author":{"name":"Gregor Martynus","url":"https://github.com/gr2m"},"bugs":{"url":"https://github.com/octokit/rest.js/issues"},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"description":"GitHub REST API client for Node.js","devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^3.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^16.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"files":["index.js","index.d.ts","lib","plugins"],"homepage":"https://github.com/octokit/rest.js#readme","keywords":["octokit","github","rest","api-client"],"license":"MIT","name":"@octokit/rest","nyc":{"ignore":["test"]},"publishConfig":{"access":"public"},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"repository":{"type":"git","url":"git+https://github.com/octokit/rest.js.git"},"scripts":{"build":"npm-run-all build:*","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","build:ts":"npm run -s update-endpoints:typescript","coverage":"nyc report --reporter=html && open coverage/index.html","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","prebuild:browser":"mkdirp dist/","pretest":"npm run -s lint","prevalidate:ts":"npm run -s build:ts","start-fixtures-server":"octokit-fixtures-server","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:code":"node scripts/update-endpoints/code","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:typescript":"node scripts/update-endpoints/typescript","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts"},"types":"index.d.ts","version":"16.38.1"}; /***/ }), /* 216 */, @@ -14238,7 +14238,7 @@ function expand(str, isTop) { /* 314 */ /***/ (function(module) { -module.exports = {"name":"@octokit/graphql","version":"2.1.3","publishConfig":{"access":"public"},"description":"GitHub GraphQL API client for browsers and Node","main":"index.js","scripts":{"prebuild":"mkdirp dist/","build":"npm-run-all build:*","build:development":"webpack --mode development --entry . --output-library=octokitGraphql --output=./dist/octokit-graphql.js --profile --json > dist/bundle-stats.json","build:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=octokitGraphql --output-path=./dist --output-filename=octokit-graphql.min.js --devtool source-map","bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","coverage":"nyc report --reporter=html && open coverage/index.html","coverage:upload":"nyc report --reporter=text-lcov | coveralls","pretest":"standard","test":"nyc mocha test/*-test.js","test:browser":"cypress run --browser chrome"},"repository":{"type":"git","url":"https://github.com/octokit/graphql.js.git"},"keywords":["octokit","github","api","graphql"],"author":"Gregor Martynus (https://github.com/gr2m)","license":"MIT","bugs":{"url":"https://github.com/octokit/graphql.js/issues"},"homepage":"https://github.com/octokit/graphql.js#readme","dependencies":{"@octokit/request":"^5.0.0","universal-user-agent":"^2.0.3"},"devDependencies":{"chai":"^4.2.0","compression-webpack-plugin":"^2.0.0","coveralls":"^3.0.3","cypress":"^3.1.5","fetch-mock":"^7.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","npm-run-all":"^4.1.3","nyc":"^14.0.0","semantic-release":"^15.13.3","simple-mock":"^0.8.0","standard":"^12.0.1","webpack":"^4.29.6","webpack-bundle-analyzer":"^3.1.0","webpack-cli":"^3.2.3"},"bundlesize":[{"path":"./dist/octokit-graphql.min.js.gz","maxSize":"5KB"}],"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"standard":{"globals":["describe","before","beforeEach","afterEach","after","it","expect"]},"files":["lib"],"_resolved":"https://registry.npmjs.org/@octokit/graphql/-/graphql-2.1.3.tgz","_integrity":"sha512-XoXJqL2ondwdnMIW3wtqJWEwcBfKk37jO/rYkoxNPEVeLBDGsGO1TCWggrAlq3keGt/O+C/7VepXnukUxwt5vA==","_from":"@octokit/graphql@2.1.3"}; +module.exports = {"_args":[["@octokit/graphql@2.1.3","/Users/user/Documents/AppCenter/setup-node-actions"]],"_from":"@octokit/graphql@2.1.3","_id":"@octokit/graphql@2.1.3","_inBundle":false,"_integrity":"sha512-XoXJqL2ondwdnMIW3wtqJWEwcBfKk37jO/rYkoxNPEVeLBDGsGO1TCWggrAlq3keGt/O+C/7VepXnukUxwt5vA==","_location":"/@octokit/graphql","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"@octokit/graphql@2.1.3","name":"@octokit/graphql","escapedName":"@octokit%2fgraphql","scope":"@octokit","rawSpec":"2.1.3","saveSpec":null,"fetchSpec":"2.1.3"},"_requiredBy":["/@actions/github"],"_resolved":"https://registry.npmjs.org/@octokit/graphql/-/graphql-2.1.3.tgz","_spec":"2.1.3","_where":"/Users/user/Documents/AppCenter/setup-node-actions","author":{"name":"Gregor Martynus","url":"https://github.com/gr2m"},"bugs":{"url":"https://github.com/octokit/graphql.js/issues"},"bundlesize":[{"path":"./dist/octokit-graphql.min.js.gz","maxSize":"5KB"}],"dependencies":{"@octokit/request":"^5.0.0","universal-user-agent":"^2.0.3"},"description":"GitHub GraphQL API client for browsers and Node","devDependencies":{"chai":"^4.2.0","compression-webpack-plugin":"^2.0.0","coveralls":"^3.0.3","cypress":"^3.1.5","fetch-mock":"^7.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","npm-run-all":"^4.1.3","nyc":"^14.0.0","semantic-release":"^15.13.3","simple-mock":"^0.8.0","standard":"^12.0.1","webpack":"^4.29.6","webpack-bundle-analyzer":"^3.1.0","webpack-cli":"^3.2.3"},"files":["lib"],"homepage":"https://github.com/octokit/graphql.js#readme","keywords":["octokit","github","api","graphql"],"license":"MIT","main":"index.js","name":"@octokit/graphql","publishConfig":{"access":"public"},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"repository":{"type":"git","url":"git+https://github.com/octokit/graphql.js.git"},"scripts":{"build":"npm-run-all build:*","build:development":"webpack --mode development --entry . --output-library=octokitGraphql --output=./dist/octokit-graphql.js --profile --json > dist/bundle-stats.json","build:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=octokitGraphql --output-path=./dist --output-filename=octokit-graphql.min.js --devtool source-map","bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","coverage":"nyc report --reporter=html && open coverage/index.html","coverage:upload":"nyc report --reporter=text-lcov | coveralls","prebuild":"mkdirp dist/","pretest":"standard","test":"nyc mocha test/*-test.js","test:browser":"cypress run --browser chrome"},"standard":{"globals":["describe","before","beforeEach","afterEach","after","it","expect"]},"version":"2.1.3"}; /***/ }), /* 315 */, @@ -65086,9 +65086,8 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) { let toolPath; toolPath = tc.find('node', versionSpec, osArch); // If not found in cache, download - if (toolPath) { - core.info(`Found in cache @ ${toolPath}`); - } + // Usage of pre-cached Node.js versions is temporarily disabled. + if (false) {} else { core.info(`Attempting to download ${versionSpec}...`); let downloadPath = ''; diff --git a/src/installer.ts b/src/installer.ts index e2084b9..beb8d94 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -71,7 +71,8 @@ export async function getNode( toolPath = tc.find('node', versionSpec, osArch); // If not found in cache, download - if (toolPath) { + // Usage of pre-cached Node.js versions is temporarily disabled. + if (false) { core.info(`Found in cache @ ${toolPath}`); } else { core.info(`Attempting to download ${versionSpec}...`); From c24389f79e91ba615d93590929027ff3d63575ae Mon Sep 17 00:00:00 2001 From: AlyonaSviridenko Date: Tue, 3 Aug 2021 18:37:52 +0300 Subject: [PATCH 6/9] Staging unstaged --- dist/setup/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index 44aa68f..edf4b44 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -8761,7 +8761,7 @@ module.exports = require("timers"); /* 215 */ /***/ (function(module) { -module.exports = {"_args":[["@octokit/rest@16.38.1","/Users/user/Documents/AppCenter/setup-node-actions"]],"_from":"@octokit/rest@16.38.1","_id":"@octokit/rest@16.38.1","_inBundle":false,"_integrity":"sha512-zyNFx+/Bd1EXt7LQjfrc6H4wryBQ/oDuZeZhGMBSFr1eMPFDmpEweFQR3R25zjKwBQpDY7L5GQO6A3XSaOfV1w==","_location":"/@octokit/rest","_phantomChildren":{"os-name":"3.1.0"},"_requested":{"type":"version","registry":true,"raw":"@octokit/rest@16.38.1","name":"@octokit/rest","escapedName":"@octokit%2frest","scope":"@octokit","rawSpec":"16.38.1","saveSpec":null,"fetchSpec":"16.38.1"},"_requiredBy":["/@actions/github"],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.38.1.tgz","_spec":"16.38.1","_where":"/Users/user/Documents/AppCenter/setup-node-actions","author":{"name":"Gregor Martynus","url":"https://github.com/gr2m"},"bugs":{"url":"https://github.com/octokit/rest.js/issues"},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"description":"GitHub REST API client for Node.js","devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^3.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^16.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"files":["index.js","index.d.ts","lib","plugins"],"homepage":"https://github.com/octokit/rest.js#readme","keywords":["octokit","github","rest","api-client"],"license":"MIT","name":"@octokit/rest","nyc":{"ignore":["test"]},"publishConfig":{"access":"public"},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"repository":{"type":"git","url":"git+https://github.com/octokit/rest.js.git"},"scripts":{"build":"npm-run-all build:*","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","build:ts":"npm run -s update-endpoints:typescript","coverage":"nyc report --reporter=html && open coverage/index.html","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","prebuild:browser":"mkdirp dist/","pretest":"npm run -s lint","prevalidate:ts":"npm run -s build:ts","start-fixtures-server":"octokit-fixtures-server","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:code":"node scripts/update-endpoints/code","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:typescript":"node scripts/update-endpoints/typescript","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts"},"types":"index.d.ts","version":"16.38.1"}; +module.exports = {"name":"@octokit/rest","version":"16.38.1","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^3.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^16.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:code":"node scripts/update-endpoints/code","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.38.1.tgz","_integrity":"sha512-zyNFx+/Bd1EXt7LQjfrc6H4wryBQ/oDuZeZhGMBSFr1eMPFDmpEweFQR3R25zjKwBQpDY7L5GQO6A3XSaOfV1w==","_from":"@octokit/rest@16.38.1"}; /***/ }), /* 216 */, @@ -14238,7 +14238,7 @@ function expand(str, isTop) { /* 314 */ /***/ (function(module) { -module.exports = {"_args":[["@octokit/graphql@2.1.3","/Users/user/Documents/AppCenter/setup-node-actions"]],"_from":"@octokit/graphql@2.1.3","_id":"@octokit/graphql@2.1.3","_inBundle":false,"_integrity":"sha512-XoXJqL2ondwdnMIW3wtqJWEwcBfKk37jO/rYkoxNPEVeLBDGsGO1TCWggrAlq3keGt/O+C/7VepXnukUxwt5vA==","_location":"/@octokit/graphql","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"@octokit/graphql@2.1.3","name":"@octokit/graphql","escapedName":"@octokit%2fgraphql","scope":"@octokit","rawSpec":"2.1.3","saveSpec":null,"fetchSpec":"2.1.3"},"_requiredBy":["/@actions/github"],"_resolved":"https://registry.npmjs.org/@octokit/graphql/-/graphql-2.1.3.tgz","_spec":"2.1.3","_where":"/Users/user/Documents/AppCenter/setup-node-actions","author":{"name":"Gregor Martynus","url":"https://github.com/gr2m"},"bugs":{"url":"https://github.com/octokit/graphql.js/issues"},"bundlesize":[{"path":"./dist/octokit-graphql.min.js.gz","maxSize":"5KB"}],"dependencies":{"@octokit/request":"^5.0.0","universal-user-agent":"^2.0.3"},"description":"GitHub GraphQL API client for browsers and Node","devDependencies":{"chai":"^4.2.0","compression-webpack-plugin":"^2.0.0","coveralls":"^3.0.3","cypress":"^3.1.5","fetch-mock":"^7.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","npm-run-all":"^4.1.3","nyc":"^14.0.0","semantic-release":"^15.13.3","simple-mock":"^0.8.0","standard":"^12.0.1","webpack":"^4.29.6","webpack-bundle-analyzer":"^3.1.0","webpack-cli":"^3.2.3"},"files":["lib"],"homepage":"https://github.com/octokit/graphql.js#readme","keywords":["octokit","github","api","graphql"],"license":"MIT","main":"index.js","name":"@octokit/graphql","publishConfig":{"access":"public"},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"repository":{"type":"git","url":"git+https://github.com/octokit/graphql.js.git"},"scripts":{"build":"npm-run-all build:*","build:development":"webpack --mode development --entry . --output-library=octokitGraphql --output=./dist/octokit-graphql.js --profile --json > dist/bundle-stats.json","build:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=octokitGraphql --output-path=./dist --output-filename=octokit-graphql.min.js --devtool source-map","bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","coverage":"nyc report --reporter=html && open coverage/index.html","coverage:upload":"nyc report --reporter=text-lcov | coveralls","prebuild":"mkdirp dist/","pretest":"standard","test":"nyc mocha test/*-test.js","test:browser":"cypress run --browser chrome"},"standard":{"globals":["describe","before","beforeEach","afterEach","after","it","expect"]},"version":"2.1.3"}; +module.exports = {"name":"@octokit/graphql","version":"2.1.3","publishConfig":{"access":"public"},"description":"GitHub GraphQL API client for browsers and Node","main":"index.js","scripts":{"prebuild":"mkdirp dist/","build":"npm-run-all build:*","build:development":"webpack --mode development --entry . --output-library=octokitGraphql --output=./dist/octokit-graphql.js --profile --json > dist/bundle-stats.json","build:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=octokitGraphql --output-path=./dist --output-filename=octokit-graphql.min.js --devtool source-map","bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","coverage":"nyc report --reporter=html && open coverage/index.html","coverage:upload":"nyc report --reporter=text-lcov | coveralls","pretest":"standard","test":"nyc mocha test/*-test.js","test:browser":"cypress run --browser chrome"},"repository":{"type":"git","url":"https://github.com/octokit/graphql.js.git"},"keywords":["octokit","github","api","graphql"],"author":"Gregor Martynus (https://github.com/gr2m)","license":"MIT","bugs":{"url":"https://github.com/octokit/graphql.js/issues"},"homepage":"https://github.com/octokit/graphql.js#readme","dependencies":{"@octokit/request":"^5.0.0","universal-user-agent":"^2.0.3"},"devDependencies":{"chai":"^4.2.0","compression-webpack-plugin":"^2.0.0","coveralls":"^3.0.3","cypress":"^3.1.5","fetch-mock":"^7.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","npm-run-all":"^4.1.3","nyc":"^14.0.0","semantic-release":"^15.13.3","simple-mock":"^0.8.0","standard":"^12.0.1","webpack":"^4.29.6","webpack-bundle-analyzer":"^3.1.0","webpack-cli":"^3.2.3"},"bundlesize":[{"path":"./dist/octokit-graphql.min.js.gz","maxSize":"5KB"}],"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"standard":{"globals":["describe","before","beforeEach","afterEach","after","it","expect"]},"files":["lib"],"_resolved":"https://registry.npmjs.org/@octokit/graphql/-/graphql-2.1.3.tgz","_integrity":"sha512-XoXJqL2ondwdnMIW3wtqJWEwcBfKk37jO/rYkoxNPEVeLBDGsGO1TCWggrAlq3keGt/O+C/7VepXnukUxwt5vA==","_from":"@octokit/graphql@2.1.3"}; /***/ }), /* 315 */, From db716f881ae727ff1c231028cc3926681f7d2e7b Mon Sep 17 00:00:00 2001 From: AlyonaSviridenko Date: Tue, 3 Aug 2021 18:53:52 +0300 Subject: [PATCH 7/9] Add yarn env variable --- .github/workflows/e2e-cache.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/e2e-cache.yml b/.github/workflows/e2e-cache.yml index 9c294f1..69e75fe 100644 --- a/.github/workflows/e2e-cache.yml +++ b/.github/workflows/e2e-cache.yml @@ -101,6 +101,8 @@ jobs: node-yarn2-depencies-caching: name: Test yarn 2 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false strategy: fail-fast: false matrix: From d21ecc7c5be116ff576d1e1dd67cf7eefbb22ed3 Mon Sep 17 00:00:00 2001 From: Alena Sviridenko Date: Wed, 4 Aug 2021 17:00:35 +0300 Subject: [PATCH 8/9] Revert "Temporarily disabled cache usage for v2" --- .github/workflows/e2e-cache.yml | 2 -- __tests__/installer.test.ts | 21 +++++++-------------- dist/setup/index.js | 5 +++-- src/installer.ts | 3 +-- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/.github/workflows/e2e-cache.yml b/.github/workflows/e2e-cache.yml index 69e75fe..9c294f1 100644 --- a/.github/workflows/e2e-cache.yml +++ b/.github/workflows/e2e-cache.yml @@ -101,8 +101,6 @@ jobs: node-yarn2-depencies-caching: name: Test yarn 2 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} - env: - YARN_ENABLE_IMMUTABLE_INSTALLS: false strategy: fail-fast: false matrix: diff --git a/__tests__/installer.test.ts b/__tests__/installer.test.ts index 85cf264..9948923 100644 --- a/__tests__/installer.test.ts +++ b/__tests__/installer.test.ts @@ -171,8 +171,7 @@ describe('setup-node', () => { // Found in cache tests //-------------------------------------------------- - // Usage of pre-cached Node.js versions is temporarily disabled. - xit('finds version in cache with stable true', async () => { + it('finds version in cache with stable true', async () => { inputs['node-version'] = '12'; inputs.stable = 'true'; @@ -183,8 +182,7 @@ describe('setup-node', () => { expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`); }); - // Usage of pre-cached Node.js versions is temporarily disabled. - xit('finds version in cache with stable not supplied', async () => { + it('finds version in cache with stable not supplied', async () => { inputs['node-version'] = '12'; inSpy.mockImplementation(name => inputs[name]); @@ -196,8 +194,7 @@ describe('setup-node', () => { expect(logSpy).toHaveBeenCalledWith(`Found in cache @ ${toolPath}`); }); - // Usage of pre-cached Node.js versions is temporarily disabled. - xit('finds version in cache and adds it to the path', async () => { + it('finds version in cache and adds it to the path', async () => { inputs['node-version'] = '12'; inSpy.mockImplementation(name => inputs[name]); @@ -387,8 +384,7 @@ describe('setup-node', () => { }, 100000); describe('check-latest flag', () => { - // Usage of pre-cached Node.js versions is temporarily disabled. - xit('use local version and dont check manifest if check-latest is not specified', async () => { + it('use local version and dont check manifest if check-latest is not specified', async () => { os.platform = 'linux'; os.arch = 'x64'; @@ -409,8 +405,7 @@ describe('setup-node', () => { ); }); - // Usage of pre-cached Node.js versions is temporarily disabled. - xit('check latest version and resolve it from local cache', async () => { + it('check latest version and resolve it from local cache', async () => { os.platform = 'linux'; os.arch = 'x64'; @@ -561,8 +556,7 @@ describe('setup-node', () => { inputs.stable = 'true'; }); - // Usage of pre-cached Node.js versions is temporarily disabled. - xit('find latest LTS version and resolve it from local cache (lts/erbium)', async () => { + it('find latest LTS version and resolve it from local cache (lts/erbium)', async () => { // arrange inputs['node-version'] = 'lts/erbium'; @@ -632,8 +626,7 @@ describe('setup-node', () => { ); }); - // Usage of pre-cached Node.js versions is temporarily disabled. - xit('find latest LTS version and resolve it from local cache (lts/*)', async () => { + it('find latest LTS version and resolve it from local cache (lts/*)', async () => { // arrange inputs['node-version'] = 'lts/*'; diff --git a/dist/setup/index.js b/dist/setup/index.js index edf4b44..1a21370 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -65086,8 +65086,9 @@ function getNode(versionSpec, stable, checkLatest, auth, arch = os.arch()) { let toolPath; toolPath = tc.find('node', versionSpec, osArch); // If not found in cache, download - // Usage of pre-cached Node.js versions is temporarily disabled. - if (false) {} + if (toolPath) { + core.info(`Found in cache @ ${toolPath}`); + } else { core.info(`Attempting to download ${versionSpec}...`); let downloadPath = ''; diff --git a/src/installer.ts b/src/installer.ts index beb8d94..e2084b9 100644 --- a/src/installer.ts +++ b/src/installer.ts @@ -71,8 +71,7 @@ export async function getNode( toolPath = tc.find('node', versionSpec, osArch); // If not found in cache, download - // Usage of pre-cached Node.js versions is temporarily disabled. - if (false) { + if (toolPath) { core.info(`Found in cache @ ${toolPath}`); } else { core.info(`Attempting to download ${versionSpec}...`); From 896ee80599ea831592cc8484629043410040b226 Mon Sep 17 00:00:00 2001 From: Alena Sviridenko Date: Wed, 4 Aug 2021 17:04:32 +0300 Subject: [PATCH 9/9] Restore YARN flag --- .github/workflows/e2e-cache.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/e2e-cache.yml b/.github/workflows/e2e-cache.yml index 9c294f1..69e75fe 100644 --- a/.github/workflows/e2e-cache.yml +++ b/.github/workflows/e2e-cache.yml @@ -101,6 +101,8 @@ jobs: node-yarn2-depencies-caching: name: Test yarn 2 (Node ${{ matrix.node-version}}, ${{ matrix.os }}) runs-on: ${{ matrix.os }} + env: + YARN_ENABLE_IMMUTABLE_INSTALLS: false strategy: fail-fast: false matrix: