@cypress/github-action 5.6.2 → 5.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +27 -1
  2. package/dist/index.js +16 -15
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # cypress-io/github-action [![Action status][ci-badge]][ci-workflow] [![cypress][cloud-badge]][cloud-project] [![renovate-app badge][renovate-badge]][renovate-bot]
2
2
 
3
- > [GitHub Action](https://docs.github.com/en/actions) for running [Cypress](https://www.cypress.io) end-to-end and component tests. Includes npm installation, custom caching and lots of configuration options.
3
+ > [GitHub Action](https://docs.github.com/en/actions) for running [Cypress](https://www.cypress.io) end-to-end and component tests. Includes npm, pnpm and Yarn installation, custom caching and lots of configuration options.
4
4
 
5
5
  ## Examples
6
6
 
@@ -40,6 +40,7 @@
40
40
  - Use [pnpm](#pnpm)
41
41
  - Use [Yarn Classic](#yarn-classic)
42
42
  - Use [Yarn Modern](#yarn-modern)
43
+ - Use [Yarn Plug'n'Play](#yarn-plugnplay)
43
44
  - Use [Yarn workspaces](#yarn-workspaces)
44
45
  - Use [custom cache key](#custom-cache-key)
45
46
  - Run tests on multiple [Node versions](#node-versions)
@@ -1077,6 +1078,31 @@ See [example-yarn-modern.yml](.github/workflows/example-yarn-modern.yml) for an
1077
1078
 
1078
1079
  [![Yarn Modern example](https://github.com/cypress-io/github-action/workflows/example-yarn-modern/badge.svg?branch=master)](.github/workflows/example-yarn-modern.yml)
1079
1080
 
1081
+ ### Yarn Plug'n'Play
1082
+
1083
+ When using [Yarn Modern](https://yarnpkg.com/) (Yarn 2 and later) with [Plug'n'Play](https://yarnpkg.com/features/pnp) enabled, you will need to use the `command` parameter to run [yarn dlx](https://yarnpkg.com/cli/dlx) instead of [npx](https://docs.npmjs.com/cli/v9/commands/npx).
1084
+
1085
+ ```yaml
1086
+ name: example-yarn-modern-pnp
1087
+ on: push
1088
+ jobs:
1089
+ yarn-classic:
1090
+ runs-on: ubuntu-22.04
1091
+ steps:
1092
+ - name: Checkout
1093
+ uses: actions/checkout@v3
1094
+ - name: Cypress run
1095
+ uses: cypress-io/github-action@v5
1096
+ with:
1097
+ working-directory: examples/yarn-modern-pnp
1098
+ install-command: yarn install
1099
+ command: yarn dlx cypress run
1100
+ ```
1101
+
1102
+ [![Yarn Plug'n'Play example](https://github.com/cypress-io/github-action/actions/workflows/example-yarn-modern-pnp.yml/badge.svg?branch=master)](https://github.com/cypress-io/github-action/actions/workflows/example-yarn-modern-pnp.yml)
1103
+
1104
+ **Caution**: using the action parameter `command` causes multiple other parameters to be ignored. [See `command` section for more information.](#custom-test-command)
1105
+
1080
1106
  ### Yarn workspaces
1081
1107
 
1082
1108
  This action should discover the Yarn workspaces correctly. For example, see folder [examples/start-and-yarn-workspaces](examples/start-and-yarn-workspaces) and workflow file [example-start-and-yarn-workspaces.yml](.github/workflows/example-start-and-yarn-workspaces.yml)
package/dist/index.js CHANGED
@@ -74479,7 +74479,7 @@ const noLockFile = () => {
74479
74479
  process.exit(1)
74480
74480
  }
74481
74481
 
74482
- // enforce the same NPM cache folder across different operating systems
74482
+ // enforce the same npm cache folder across different operating systems
74483
74483
  const NPM_CACHE_FOLDER = path.join(homeDirectory, '.npm')
74484
74484
  const getNpmCache = () => {
74485
74485
  const o = {}
@@ -74505,7 +74505,7 @@ const getNpmCache = () => {
74505
74505
  o.inputPath = NPM_CACHE_FOLDER
74506
74506
  }
74507
74507
 
74508
- // use exact restore key to prevent NPM cache from growing
74508
+ // use exact restore key to prevent npm cache from growing
74509
74509
  // https://glebbahmutov.com/blog/do-not-let-npm-cache-snowball/
74510
74510
  o.restoreKeys = o.primaryKey = key
74511
74511
  return o
@@ -74532,21 +74532,21 @@ const getCypressBinaryCache = () => {
74532
74532
  }
74533
74533
 
74534
74534
  const restoreCachedNpm = () => {
74535
- debug('trying to restore cached NPM modules')
74535
+ debug('trying to restore cached npm modules')
74536
74536
  const NPM_CACHE = getNpmCache()
74537
74537
  return restoreCache([NPM_CACHE.inputPath], NPM_CACHE.primaryKey, [
74538
74538
  NPM_CACHE.restoreKeys
74539
74539
  ]).catch((e) => {
74540
- console.warn('Restoring NPM cache error: %s', e.message)
74540
+ console.warn('Restoring npm cache error: %s', e.message)
74541
74541
  })
74542
74542
  }
74543
74543
 
74544
74544
  const saveCachedNpm = () => {
74545
- debug('saving NPM modules')
74545
+ debug('saving npm modules')
74546
74546
  const NPM_CACHE = getNpmCache()
74547
74547
  return saveCache([NPM_CACHE.inputPath], NPM_CACHE.primaryKey).catch(
74548
74548
  (e) => {
74549
- console.warn('Saving NPM cache error: %s', e.message)
74549
+ console.warn('Saving npm cache error: %s', e.message)
74550
74550
  }
74551
74551
  )
74552
74552
  }
@@ -74584,7 +74584,7 @@ const install = () => {
74584
74584
  // prevent lots of progress messages during install
74585
74585
  core.exportVariable('CI', '1')
74586
74586
  core.exportVariable('CYPRESS_CACHE_FOLDER', CYPRESS_CACHE_FOLDER)
74587
- // set NPM cache path in case the user has custom install command
74587
+ // set npm cache path in case the user has custom install command
74588
74588
  core.exportVariable('npm_config_cache', NPM_CACHE_FOLDER)
74589
74589
 
74590
74590
  // Note: need to quote found tool to avoid Windows choking on
@@ -74596,7 +74596,7 @@ const install = () => {
74596
74596
  }
74597
74597
 
74598
74598
  if (useYarn()) {
74599
- debug('installing NPM dependencies using Yarn')
74599
+ debug('installing npm dependencies using Yarn')
74600
74600
  return io.which('yarn', true).then((yarnPath) => {
74601
74601
  debug(`yarn at "${yarnPath}"`)
74602
74602
  return exec.exec(
@@ -74606,7 +74606,7 @@ const install = () => {
74606
74606
  )
74607
74607
  })
74608
74608
  } else if (usePnpm()) {
74609
- debug('installing NPM dependencies using pnpm')
74609
+ debug('installing npm dependencies using pnpm')
74610
74610
  return io.which('pnpm', true).then((pnpmPath) => {
74611
74611
  debug(`pnpm at "${pnpmPath}"`)
74612
74612
  return exec.exec(
@@ -74616,7 +74616,7 @@ const install = () => {
74616
74616
  )
74617
74617
  })
74618
74618
  } else {
74619
- debug('installing NPM dependencies')
74619
+ debug('installing npm dependencies')
74620
74620
  return io.which('npm', true).then((npmPath) => {
74621
74621
  debug(`npm at "${npmPath}"`)
74622
74622
  return exec.exec(quote(npmPath), ['ci'], cypressCommandOptions)
@@ -75008,10 +75008,6 @@ const runTests = async () => {
75008
75008
  quiet: getInputBool('quiet'),
75009
75009
  component: getInputBool('component')
75010
75010
  }
75011
- const cypressModulePath =
75012
- require.resolve('cypress', { paths: [workingDirectory] }) ||
75013
- 'cypress'
75014
- const cypress = require(cypressModulePath)
75015
75011
  const runTests = getInputBool('runTests', true)
75016
75012
  const spec = getSpecsList()
75017
75013
 
@@ -75033,7 +75029,12 @@ const runTests = async () => {
75033
75029
  return runTestsUsingCommandLine()
75034
75030
  }
75035
75031
 
75036
- debug('Running Cypress tests using NPM module API')
75032
+ const cypressModulePath =
75033
+ require.resolve('cypress', { paths: [workingDirectory] }) ||
75034
+ 'cypress'
75035
+ const cypress = require(cypressModulePath)
75036
+
75037
+ debug('Running Cypress tests using Module API')
75037
75038
  debug(`requiring cypress dependency, cwd is ${process.cwd()}`)
75038
75039
  debug(`working directory ${workingDirectory}`)
75039
75040
  debug(`resolved cypress ${cypressModulePath}`)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cypress/github-action",
3
- "version": "5.6.2",
3
+ "version": "5.7.1",
4
4
  "description": "GitHub Action for running Cypress end-to-end and component tests",
5
5
  "private": false,
6
6
  "main": "dist/index.js",