Created
August 13, 2017 14:54
-
-
Save davidwessman/4988c261ae3b9f3b6b0962da2cb7bfe1 to your computer and use it in GitHub Desktop.
CircleCI 2.0 setup
This file contains hidden or 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
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