Skip to content
Permalink
30f08c4b41
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
78 lines (65 sloc) 1.97 KB
version: 2.1
orbs:
rubocop: hanachin/rubocop@0.0.6
jobs:
build:
docker:
- image: circleci/<< parameters.ruby_version >>
- image: circleci/postgres:9.6.2-alpine
- image: circleci/mysql:5.7
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
parameters:
ruby_version:
type: string
gemfile:
type: string
environment:
BUNDLE_GEMFILE: << parameters.gemfile >>
steps:
- checkout
# Restore Cached Dependencies
# - restore_cache:
# keys:
# - gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "<< parameters.gemfile >>.lock" }}
# - gem-cache-v1-{{ arch }}-{{ .Branch }}
# - gem-cache-v1
- run: bundle install --path vendor/bundle
# - save_cache:
# key: gem-cache-v1-{{ arch }}-{{ .Branch }}-{{ checksum "<< parameters.gemfile >>.lock" }}
# paths:
# - vendor/bundle
- run:
name: Install postgres client
command: sudo apt install -y postgresql-client
- run:
name: Install mysql client
command: sudo apt install -y default-mysql-client
- run:
name: Configure config database.yml
command: bundle exec rake db:copy_credentials
- run:
name: wait for postgresql
command: dockerize -wait tcp://localhost:5432 -timeout 1m
- run:
name: wait for mysql
command: dockerize -wait tcp://localhost:3306 -timeout 1m
- run:
name: Database Setup
command: |
bundle exec rake db:test:prepare
- run:
name: Run tests
command: bundle exec rspec
workflows:
tests:
jobs:
- build:
matrix:
parameters:
ruby_version: ["ruby:2.6-buster", "ruby:2.7-buster"]
gemfile: ["gemfiles/rails_5_2.gemfile", "gemfiles/rails_6_0.gemfile"]
rubocop:
jobs:
- rubocop/rubocop:
version: 0.88.0