我们的项目有CircleCI CI / CD管道。我将需要设置cypress测试以在CircleCi管道上运行。有人可以建议使用npm install
命令在根文件夹下创建circle.yml
或.circleci/config.yml file
答案 0 :(得分:0)
这是我的0
的一个示例,它位于我的项目根目录中:
circle.yml
您可以用cypress cli命令替换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