我们正在为我们的项目准备Circleci
CI / CD管道。我将需要设置cypress测试以在CircleCi管道上运行。任何人都可以建议有关npm install
命令在根文件夹下创建circle.yml or .circleci/config.yml file
的信息:
这是我的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
您可以用cypress cli命令替换yarn test-e2e
,例如npm run cypress:run