Guest User

Untitled

a guest
Jun 18th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. version: 2
  2. jobs:
  3. build:
  4. parallelism: 2 # however many CPUs you need/pay for
  5.  
  6. #############################################
  7. # Container Setup
  8. #############################################
  9. docker:
  10. - image: circleci/ruby:2.5.0
  11. environment:
  12. - RAILS_ENV=test
  13. - image: circleci/mysql:5.7
  14. environment:
  15. - MYSQL_ROOT_HOST=%
  16. - MYSQL_ROOT_PASSWORD=circleci
  17. - image: redis:4.0.9
  18. - image: elasticsearch:2.3
  19.  
  20. #############################################
  21. # Build Steps
  22. #############################################
  23. steps:
  24. - checkout
  25. - run:
  26. name: Configure secrets.yml
  27. command: mv config/secrets.ci.yml config/secrets.yml
  28. - run:
  29. name: Configure database.yml
  30. command: mv config/database.ci.yml config/database.yml
  31.  
  32. ###########################################
  33. # Bundler w/ caching
  34. ###########################################
  35. - restore_cache:
  36. keys:
  37. - rails-bundle-{{ checksum "Gemfile.lock" }}
  38. - rails-bundle-
  39. - run:
  40. name: Bundle Gems
  41. command: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle
  42. - save_cache:
  43. key: rails-bundle-{{ checksum "Gemfile.lock" }}
  44. paths:
  45. - vendor/bundle
  46.  
  47. ###########################################
  48. # Database
  49. ###########################################
  50. - run:
  51. name: Wait for MySQL
  52. command: dockerize -wait tcp://127.0.0.1:3306 -timeout 1m
  53. - run:
  54. name: Load DB schema
  55. command: bin/rails db:schema:load --trace
  56.  
  57. ###########################################
  58. # Run rspec in parallel
  59. ###########################################
  60. - run:
  61. name: Run rspec in parallel
  62. command: |
  63. bundle exec rspec --profile 10 \
  64. --format RspecJunitFormatter \
  65. --out test_results/rspec.xml \
  66. --format progress \
  67. $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
  68.  
  69. # Save test results for timing analysis
  70. - store_test_results:
  71. path: test_results
Add Comment
Please, Sign In to add comment