0

We are having CircleCI CI/CD pipeline for our project. I would need to setup cypress test to run on CircleCi pipeline. Could anyone please advise about the npm install command to create circle.yml or .circleci/config.yml file under the root folder:

enter image description here

halfer
  • 19,824
  • 17
  • 99
  • 186
soccerway
  • 10,371
  • 19
  • 67
  • 132
  • You don't use a `npm` command to create a CircleCI YAML config - that is written manually and added to the repo manually. – halfer Oct 23 '19 at 13:09

1 Answers1

0

Here's an example of my circle.yml, which is located in my project root:

version: 2.1
jobs:
  test:
    docker:
    - image: cypress/base:10
    steps:
    - checkout
    - restore_cache:
        keys:
        - cache-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
    - run:
        name: Yarn install
        command: yarn install --frozen-lockfile
    - save_cache:
        key: cache-{{ arch }}-{{ .Branch }}-{{ checksum "package.json" }}
        paths:
        - ~/.cache
    - run:
        command: yarn lint
    - run:
        command: yarn test
    - run:
        command: yarn test-e2e
    - run:
        command: yarn run semantic-release
workflows:
  build:
    jobs:
    - test
  version: 2

You can replace yarn test-e2e with your cypress cli command, for example npm run cypress:run

kuceb
  • 16,573
  • 7
  • 42
  • 56