MCPcopy Create free account
hub / github.com/cypress-io/github-action / install

Function install

index.js:232–274  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230}
231
232const install = () => {
233 // prevent lots of progress messages during install
234 core.exportVariable('CI', '1')
235 core.exportVariable('CYPRESS_CACHE_FOLDER', CYPRESS_CACHE_FOLDER)
236 // set npm cache path in case the user has custom install command
237 core.exportVariable('npm_config_cache', NPM_CACHE_FOLDER)
238
239 // Note: need to quote found tool to avoid Windows choking on
240 // npm paths with spaces like "C:\Program Files\nodejs\npm.cmd ci"
241 const installCommand = core.getInput('install-command')
242 if (installCommand) {
243 debug(`using custom install command "${installCommand}"`)
244 return execCommand(installCommand, true, 'install command')
245 }
246
247 if (useYarn()) {
248 debug('installing npm dependencies using Yarn')
249 return io.which('yarn', true).then((yarnPath) => {
250 debug(`yarn at "${yarnPath}"`)
251 return exec.exec(
252 quote(yarnPath),
253 ['--frozen-lockfile'],
254 cypressCommandOptions
255 )
256 })
257 } else if (usePnpm()) {
258 debug('installing npm dependencies using pnpm')
259 return io.which('pnpm', true).then((pnpmPath) => {
260 debug(`pnpm at "${pnpmPath}"`)
261 return exec.exec(
262 quote(pnpmPath),
263 ['install', '--frozen-lockfile'],
264 cypressCommandOptions
265 )
266 })
267 } else {
268 debug('installing npm dependencies')
269 return io.which('npm', true).then((npmPath) => {
270 debug(`npm at "${npmPath}"`)
271 return exec.exec(quote(npmPath), ['ci'], cypressCommandOptions)
272 })
273 }
274}
275
276const listCypressBinaries = () => {
277 debug(

Callers 1

installMaybeFunction · 0.85

Calls 3

execCommandFunction · 0.85
useYarnFunction · 0.85
usePnpmFunction · 0.85

Tested by

no test coverage detected