【问题标题】:What is the npm command to install .circleci/config.yml for cypress test为 cypress 测试安装 .circleci/config.yml 的 npm 命令是什么
【发布时间】:2019-10-17 00:49:03
【问题描述】:

我们的项目正在使用 CircleCI CI/CD 管道。我需要设置 cypress 测试才能在 CircleCi 管道上运行。谁能告诉我npm install 命令在根文件夹下创建circle.yml.circleci/config.yml file

【问题讨论】:

  • 您不使用npm 命令来创建 CircleCI YAML 配置 - 手动编写并手动添加到 repo。

标签: cypress circleci


【解决方案1】:

这是我的circle.yml 的示例,它位于我的项目根目录中:

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

您可以将yarn test-e2e 替换为您的cypress cli 命令,例如npm run cypress:run

【讨论】:

    猜你喜欢
    • 2013-08-08
    • 1970-01-01
    • 2019-09-15
    • 2019-06-28
    • 1970-01-01
    • 1970-01-01
    • 2019-04-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多