Guest User

Untitled

a guest
May 20th, 2018
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. version: 2
  2. jobs:
  3. build:
  4. parallelism: 3
  5. docker:
  6. - image: circleci/ruby:2.4-node
  7. environment:
  8. BUNDLE_JOBS: 3
  9. BUNDLE_RETRY: 3
  10. BUNDLE_PATH: vendor/bundle
  11. PGHOST: 127.0.0.1
  12. PGUSER: circleci-demo-ruby
  13. RAILS_ENV: test
  14. - image: circleci/postgres:9.5-alpine
  15. environment:
  16. POSTGRES_USER: circleci-demo-ruby
  17. POSTGRES_DB: rails_blog
  18. POSTGRES_PASSWORD: ""
  19. steps:
  20. - checkout
  21.  
  22. # Which version of bundler?
  23. - run:
  24. name: Which bundler?
  25. command: bundle -v
  26.  
  27. # Restore bundle cache
  28. - restore_cache:
  29. keys:
  30. - rails-demo-bundle-v2-{{ checksum "Gemfile.lock" }}
  31. - rails-demo-bundle-v2-
  32.  
  33. - run:
  34. name: Bundle Install
  35. command: bundle check || bundle install
  36.  
  37. # Store bundle cache
  38. - save_cache:
  39. key: rails-demo-bundle-v2-{{ checksum "Gemfile.lock" }}
  40. paths:
  41. - vendor/bundle
  42.  
  43. # Only necessary if app uses webpacker or yarn in some other way
  44. - restore_cache:
  45. keys:
  46. - rails-demo-yarn-{{ checksum "yarn.lock" }}
  47. - rails-demo-yarn-
  48.  
  49. - run:
  50. name: Yarn Install
  51. command: yarn install --cache-folder ~/.cache/yarn
  52.  
  53. # Store yarn / webpacker cache
  54. - save_cache:
  55. key: rails-demo-yarn-{{ checksum "yarn.lock" }}
  56. paths:
  57. - ~/.cache/yarn
  58.  
  59. - run:
  60. name: Wait for DB
  61. command: dockerize -wait tcp://localhost:5432 -timeout 1m
  62.  
  63. - run:
  64. name: Database setup
  65. command: bin/rails db:schema:load --trace
  66.  
  67. # Run rspec in parallel
  68. - type: shell
  69. command: |
  70. bundle exec rspec --profile 10 \
  71. --format RspecJunitFormatter \
  72. --out test_results/rspec.xml \
  73. --format progress \
  74. $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)
  75.  
  76.  
  77. # Save test results for timing analysis
  78. - store_test_results:
  79. path: test_results
Add Comment
Please, Sign In to add comment