Created
November 7, 2018 21:56
-
-
Save mxygem/70719bb9beab92cd2322d62898df6881 to your computer and use it in GitHub Desktop.
Refactored circle.yaml
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
aliases: | |
- &restore_gem_cache | |
keys: | |
- v1-gemfile-{{ checksum "Gemfile.lock" }} | |
- &save_gem_cache | |
name: Saving gem cache | |
key: v1-gemfile-{{ checksum "Gemfile.lock" }} | |
paths: | |
- ~/data/vendor/bundle | |
- &bundle_install | |
name: Install Gems | |
command: bundle install --path=vendor/bundle --jobs=4 --retry=3 | |
- &attach_workspace | |
attach_workspace: | |
at: ~/data | |
- &dependencies | |
- checkout | |
- *attach_workspace | |
- restore_cache: *restore_gem_cache | |
- run: *bundle_install | |
- save_cache: *save_gem_cache | |
- persist_to_workspace: | |
root: . | |
paths: | |
- vendor/bundle | |
- &db_setup | |
name: Setup DB | |
command: | | |
bundle exec rake simulated_db_create | |
bundle exec rake simulated_db_load | |
- &database | |
- checkout | |
- *attach_workspace | |
- run: *bundle_install | |
- run: *db_setup | |
- &run_rspec | |
name: RSpec | |
command: bundle exec rake simulated_rspec | |
- &rspec_steps | |
- checkout | |
- *attach_workspace | |
- run: *bundle_install | |
- run: *run_rspec | |
- &cucumber | |
name: Cucumber | |
command: | | |
echo "cucumber feature - ${FEATURE}" | |
bundle exec cucumber ${FEATURE} | |
- &selenium | |
name: Selenium | |
command: bundle exec rake simulated_selenium | |
- &selenium_steps | |
- checkout | |
- *attach_workspace | |
- run: *bundle_install | |
- run: *selenium | |
- &cucumber_steps | |
- checkout | |
- *attach_workspace | |
- run: *bundle_install | |
- run: *cucumber | |
- &stage_deploy | |
name: Stage Deploy | |
command: make build_stage | |
- &deploy_stage | |
- checkout | |
- run: apk add --update make | |
- run: *stage_deploy | |
- &prod_deploy | |
name: Prod Deploy | |
command: make build_prod | |
- &deploy_prod | |
- checkout | |
- *attach_workspace | |
- run: *bundle_install | |
- run: *prod_deploy | |
# Requirement groups | |
- &deps | |
- "Dependencies" | |
- &deps_and_deploy | |
- "Dependencies" | |
- "Stage Deploy" | |
- &deps_and_db | |
- "Dependencies" | |
- "Database" | |
- &all_test | |
- "RSpec" | |
- "Cucumber Number Addition" | |
- "Cucumber Number Subtraction" | |
- "Cucumber Alphas" | |
- "Selenium Firefox" | |
- "Selenium Chrome" | |
- "Selenium Safari" | |
- "Selenium iPhone" | |
- "Selenium iPad" | |
- "Selenium Pixel 3" | |
# Build environments | |
- &deploy_environment | |
working_directory: ~/data | |
docker: | |
- image: alpine:latest | |
- &test_environment | |
working_directory: ~/data | |
docker: | |
- image: ruby:2.4 | |
version: 2 | |
workflows: | |
version: 2 | |
master: | |
jobs: | |
- "Stage Deploy" | |
- "Dependencies" | |
- "Database": | |
requires: *deps | |
- "RSpec": | |
requires: *deps_and_db | |
- "Cucumber Number Addition": | |
requires: *deps_and_db | |
- "Cucumber Number Subtraction": | |
requires: *deps_and_db | |
- "Cucumber Alphas": | |
requires: *deps_and_db | |
- "Selenium Firefox": | |
requires: *deps_and_deploy | |
- "Selenium Chrome": | |
requires: *deps_and_deploy | |
- "Selenium Safari": | |
requires: *deps_and_deploy | |
- "Selenium iPhone": | |
requires: *deps_and_deploy | |
- "Selenium iPad": | |
requires: *deps_and_deploy | |
- "Selenium Pixel 3": | |
requires: *deps_and_deploy | |
- "Deploy Prod": | |
requires: *all_test | |
jobs: | |
"Stage Deploy": | |
<<: *deploy_environment | |
steps: *deploy_stage | |
"Dependencies": | |
<<: *test_environment | |
steps: *dependencies | |
"Database": | |
<<: *test_environment | |
steps: *database | |
"RSpec": | |
<<: *test_environment | |
steps: *rspec_steps | |
"Cucumber Number Addition": | |
<<: *test_environment | |
environment: | |
FEATURE: features/number_addition.feature | |
steps: *cucumber_steps | |
"Cucumber Number Subtraction": | |
<<: *test_environment | |
environment: | |
FEATURE: features/number_subtraction.feature | |
steps: *cucumber_steps | |
"Cucumber Alphas": | |
<<: *test_environment | |
environment: | |
FEATURE: features/alphabet.feature | |
steps: *cucumber_steps | |
"Selenium Firefox": | |
<<: *test_environment | |
environment: | |
platform: firefox | |
version: latest | |
steps: *selenium_steps | |
"Selenium Chrome": | |
<<: *test_environment | |
environment: | |
platform: chrome | |
version: latest | |
steps: *selenium_steps | |
"Selenium Safari": | |
<<: *test_environment | |
environment: | |
platform: safari | |
version: latest | |
steps: *selenium_steps | |
"Selenium iPhone": | |
<<: *test_environment | |
environment: | |
platform: iphone_xs | |
version: '12' | |
steps: *selenium_steps | |
"Selenium Pixel 3": | |
<<: *test_environment | |
environment: | |
platform: pixel3 | |
version: '9' | |
steps: *selenium_steps | |
"Selenium iPad": | |
<<: *test_environment | |
environment: | |
platform: ipad | |
version: '12' | |
steps: *selenium_steps | |
"Deploy Prod": | |
<<: *test_environment | |
steps: *deploy_prod |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment