Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
defaults
113 changes: 113 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
---
version: 2

docker_image: &docker_image
image: circleci/ruby:latest-node-browsers

restore_repo: &restore_repo
restore_cache:
keys:
- v1-repo-{{ .Branch }}-{{ .Revision }}
- v1-repo-{{ .Branch }}
- v1-repo

restore_bundle: &restore_bundle
restore_cache:
keys:
- v1-bundle-{{ checksum "Gemfile.lock" }}-{{ checksum "yarn.lock" }}
- v1-bundle

jobs:
checkout_code:
docker:
- <<: *docker_image
steps:
- *restore_repo
- checkout
- save_cache:
key: v1-repo-{{ .Branch }}-{{ .Revision }}
paths:
- .

bundle:
docker:
- <<: *docker_image
environment:
BUNDLE_SILENCE_ROOT_WARNING: "true"
RAILS_ENV: test
NODE_ENV: test
steps:
- *restore_repo
- checkout
- *restore_bundle
- run: gem update bundler
- run: bundle config set path 'vendor/bundle'
- run: bundle install --jobs=4 --retry=3
- run: yarn install
- run: bin/rails webpacker:compile
- save_cache:
key: v1-bundle-{{ checksum "Gemfile.lock" }}-{{ checksum "yarn.lock" }}
paths:
- vendor/bundle
- public/packs-test

rubocop:
docker:
- <<: *docker_image
steps:
- *restore_repo
- *restore_bundle
- run: gem update bundler
- run: bundle config set path 'vendor/bundle'
- run: bundle check
- run: bin/rubocop

rspec:
parallelism: 4
docker:
- <<: *docker_image
environment:
PGHOST: 127.0.0.1
RAILS_ENV: test
NODE_ENV: test
- image: circleci/postgres
environment:
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_USER: circleci
steps:
- *restore_repo
- *restore_bundle
- run: gem update bundler
- run: bundle config set path 'vendor/bundle'
- run: bundle check
- run: dockerize -wait tcp://127.0.0.1:5432 -timeout 120s
- run: bundle exec rake db:create
- run: bundle exec rake db:schema:load
- run:
command: |
mkdir /tmp/test-results
bundle exec rspec \
--format RspecJunitFormatter \
--out /tmp/test-results/rspec.xml \
--format progress \
$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings --timings-type=filename)
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: /tmp/test-results
destination: test-results

workflows:
version: 2
main:
jobs:
- checkout_code
- bundle:
requires:
- checkout_code
- rubocop:
requires:
- bundle
- rspec:
requires:
- bundle
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_URL=///app_development
1 change: 1 addition & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DATABASE_URL=///app_test
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'

# Ignore bundler config.
/.bundle

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep

# Ignore uploaded files in development.
/storage/*
!/storage/.keep

/public/assets
.byebug_history

# Ignore master key for decrypting credentials and more.
/config/master.key

/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity

.env.development.local
.env.test.local
1 change: 1 addition & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--require rails_helper
50 changes: 50 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
require:
- rubocop-rails
- rubocop-rspec

AllCops:
NewCops: enable
TargetRubyVersion: 2.7
TargetRailsVersion: 6.0
Exclude:
- bin/**/*
- db/schema.rb
- node_modules/**/*
- vendor/**/*

Rails:
Enabled: true

Layout/LineLength:
Max: 125

Metrics/AbcSize:
Exclude:
- db/migrate/**/*

Metrics/BlockLength:
Exclude:
- spec/**/*

Metrics/MethodLength:
Exclude:
- db/migrate/**/*

Rails/FilePath:
EnforcedStyle: arguments

RSpec/ExampleLength:
Max: 10

Style/Documentation:
Enabled: false

Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma
1 change: 1 addition & 0 deletions .ruby-gemset
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rails-template
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-2.7.1
57 changes: 57 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.1'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.3', '>= 6.0.3.1'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 4.1'
# Use SCSS for stylesheets
gem 'sass-rails', '>= 6'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

gem 'dotenv-rails'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'factory_bot_rails'
gem 'rails-controller-testing'
gem 'rspec-rails'
gem 'rubocop-rails'
gem 'rubocop-rspec'
end

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'listen', '~> 3.2'
gem 'web-console', '>= 3.3.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-commands-rspec'
gem 'spring-watcher-listen', '~> 2.0.0'
end

group :test do
gem 'rspec_junit_formatter'
end
Loading