Created
April 8, 2021 18:42
-
-
Save searls/98260ce09bc4efeaabffd968f93ddef2 to your computer and use it in GitHub Desktop.
This file contains 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: | |
docker: | |
- image: cimg/ruby:3.0.1-browsers | |
environment: | |
PAGER: cat # https://stackoverflow.com/questions/53055044/rails-rake-dbstructureload-times-out-on-circleci-2-0 | |
SKIP_SCHEMA_DUMP: true # pg_dump: error: server version: 13.2; pg_dump version: 12.6 | |
CYPRESS_RAILS_CYPRESS_OPTS: "--record --key ace11e57-d9d5-443d-8882-b2ecf0488a6d" | |
- image: circleci/postgres:13.2 | |
environment: | |
POSTGRES_USER: circleci | |
POSTGRES_HOST_AUTH_METHOD: trust | |
steps: | |
- checkout | |
- run: sudo apt-get update -qq && sudo apt-get install -y postgresql | |
# Bundle install dependencies | |
- restore_cache: | |
keys: | |
- v1-bundler-{{ checksum "Gemfile.lock" }} | |
# fallback to using the latest cache if no exact match is found | |
- v1-bundler- | |
- run: bundle install --path vendor/bundle | |
- save_cache: | |
paths: | |
- vendor/bundle | |
key: v1-bundler-{{ checksum "Gemfile.lock" }} | |
# Yarn dependencies | |
- restore_cache: | |
keys: | |
- v1-yarn-{{ checksum "yarn.lock" }} | |
# fallback to using the latest cache if no exact match is found | |
- v1-yarn- | |
- run: yarn install | |
- save_cache: | |
paths: | |
- node_modules | |
- ~/.cache | |
key: v1-yarn-{{ checksum "yarn.lock" }} | |
- run: | |
name: Create .env | |
command: cp .env.example .env | |
- run: | |
name: Install Ruby deps | |
command: bin/bundle install --deployment --jobs=4 --without=production:development | |
- run: | |
name: Install node deps | |
command: yarn install | |
- run: | |
name: Set up database and run migrations | |
command: bin/rake db:create db:migrate db:test:prepare | |
- run: | |
name: Run tests | |
command: ./script/test |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment