Skip to content

Instantly share code, notes, and snippets.

@Eric-Guo
Forked from davidwessman/.circleci-config.yml
Created September 10, 2017 15:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Eric-Guo/5d8f7c0b15d49e8ccc11793e09660f75 to your computer and use it in GitHub Desktop.
CircleCI 2.0 setup
version: 2
jobs:
build:
working_directory: ~/mowers
docker:
- image: circleci/ruby:2.4.1-node
environment:
PGHOST: 127.0.0.1
PGUSER: mower
RAILS_ENV: test
- image: circleci/postgres:9.6.3-alpine
environment:
POSTGRES_USER: mower
POSTGRES_DB: mowers_test
POSTGRES_PASSWORD: ""
steps:
- checkout
- restore_cache:
keys:
- gem-cache-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
- gem-cache-{{ .Branch }}
- gem-cache
- run: bundle install --path vendor/bundle
- save_cache:
key: gem-cache-{{ .Branch }}-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- restore_cache:
keys:
- yarn-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
- yarn-cache-{{ .Branch }}
- yarn-cache
- run: yarn install
- save_cache:
key: yarn-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}
paths:
- node_modules
- run:
name: Wait for DB
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: Database setup
command: bin/rails db:schema:load --trace
- run:
name: Run rspec
command: |
bundle exec rspec --profile 10 \
--format progress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment