.circleci/config.yml
version: 2
defaults: &defaults
docker:
- image: decidim/decidim:0.9-test
environment:
BUNDLE_GEMFILE: /app/Gemfile
SIMPLECOV: true
DATABASE_USERNAME: postgres
FAIL_FAST: true
- image: postgres
environment:
POSTGRES_USER: postgres
working_directory: /app
jobs:
tests:
<<: *defaults
steps:
- checkout
- restore_cache:
keys:
- bundler-dependencies-{{ checksum "Gemfile.lock" }}
- run:
name: Install ruby dependencies
command: bundle install --jobs=4 --retry=3
- save_cache:
key: bundler-dependencies-{{ checksum "Gemfile.lock" }}
paths:
- /usr/local/bundle/
- run:
name: Wait for db
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: Create test DB
command: RAILS_ENV=test bundle exec rails db:create db:schema:load
- run:
name: Precompile assets
command: RAILS_ENV=test bundle exec rake assets:precompile
- run:
name: Run tests
command: bundle exec rake
- store_artifacts:
path: /app/tmp/capybara
workflows:
version: 2
test:
jobs:
- tests