Created
August 18, 2021 22:05
-
-
Save Ebazhanov/ae115f1da3fac13c1a6667e7a123fdc4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
references: | |
cypress: &circleci_image | |
circleci/node:latest-browsers | |
working_directory: &working_directory | |
~/tmp | |
aliases: | |
- &deploy_environment | |
docker: | |
- image: *circleci_image | |
environment: | |
TERM: xterm | |
resource_class: small | |
working_directory: *working_directory | |
- &restore_package_json_cache | |
name: Restore package.json cache | |
key: v2-deps-{{ .Branch }}-{{ checksum "package.json" }} | |
- &save_package_json_cache | |
name: Save cache both yarn and Cypress! | |
key: v2-deps-{{ .Branch }}-{{ checksum "package.json" }} | |
paths: | |
- ~/.cache | |
- &run_e2e_cypress_tests_part_1 | |
name: Run cypress E2E tests | |
command: yarn cy:run:part_1 | |
- &run_e2e_cypress_tests_part_2 | |
name: Run cypress E2E tests | |
command: yarn cy:run:part_2 | |
- &cypress_video_artifacts | |
name: Uploading cypress/videos artifacts | |
path: cypress/videos | |
- &cypress_screenshots_artifacts | |
name: Uploading cypress/screenshots artifacts | |
path: cypress/screenshots | |
- &install_yarn | |
name: Install all dependencies for a project | |
command: yarn install | |
- &persist_to_workspace | |
persist_to_workspace: | |
root: ~/ | |
paths: | |
- .cache | |
- tmp | |
- &attach_workspace | |
attach_workspace: | |
at: ~/ | |
version: 2 | |
jobs: | |
build: | |
<<: *deploy_environment | |
steps: | |
- checkout | |
- restore_cache: *restore_package_json_cache | |
- run: *install_yarn | |
- save_cache: *save_package_json_cache | |
- *persist_to_workspace | |
tests_part_1: | |
<<: *deploy_environment | |
steps: | |
- *attach_workspace | |
- run: *run_e2e_cypress_tests_part_1 | |
- store_artifacts: *cypress_video_artifacts | |
- store_artifacts: *cypress_screenshots_artifacts | |
tests_part_2: | |
<<: *deploy_environment | |
steps: | |
- *attach_workspace | |
- run: *run_e2e_cypress_tests_part_2 | |
- store_artifacts: *cypress_video_artifacts | |
- store_artifacts: *cypress_screenshots_artifacts | |
workflows: | |
version: 2 | |
build_and_test: | |
jobs: | |
- build | |
- tests_part_1: | |
requires: | |
- build | |
- tests_part_2: | |
requires: | |
- build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment