bahmutov / cypress-split

Split Cypress specs across parallel CI machines for speed
MIT License
201 stars 23 forks source link

How to run dev server before cypress-split? #152

Closed wpplumber closed 8 months ago

wpplumber commented 8 months ago

Welcome @bahmutov,

I upgraded my project to use your plugin with GHA but the code below seems not working!

I copied other files from cypress-split-example repo and modified the config.yml in .circleci to include the code below:

with: record: false

wait-on-timeout: 120

      browser: chrome
      start: npm run dev
# to use orbs, must use version >= 2.1
version: 2.1
orbs:
  # import Cypress orb by specifying an exact version x.y.z
  # or the latest version 1.x.x using "@1" syntax
  # https://github.com/cypress-io/circleci-orb
  cypress: cypress-io/cypress@2.2.0
workflows:
  build:
    jobs:
      # "cypress" is the name of the imported orb
      # "run" is the name of the job defined in Cypress orb
      - cypress/run:
          with:
          record: false
          # wait-on-timeout: 120
          browser: chrome
          start: npm run dev
          executor: cypress/base-16-14-2-slim
          # run N identical job containers
          parallelism: 3
          # built-in CircleCI environment variables
          # https://circleci.com/docs/variables/#built-in-environment-variables
          build: npx @bahmutov/print-env CIRCLE
          command: npx cypress run --env split=true
          # no further jobs, thus no need to save the files
          no-workspace: true
wpplumber commented 8 months ago

Using the code below made it, thank you for this useful plugin.

    uses: cypress-io/github-action@v5
    with:
       start: npm run dev