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
97 changes: 97 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: CI

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:11
ports: ['5432:5432']
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- uses: actions/checkout@v2
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x

- name: Install library for postgres
run: sudo apt-get install libpq-dev

- name: Install gems
run: |
gem install bundler
bundle install

- name: Setup database
env:
DATABASE_URL: postgres://postgres:@localhost:5432/rock_test
run: |
cp config/database.yml.sample config/database.yml
bundle exec rails db:create db:migrate

- name: RSpec
run: bundle exec rspec spec

rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x

- name: Install rubocop
run: gem install rubocop

- name: Rubocop
run: bundle exec rubocop

security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x

- name: Install security gems
run: |
gem install brakeman
gem install bundler-audit

- name: Run Brakeman
run: bundle exec brakeman -q

- name: Run bundler-audit
run: bundle exec bundle audit check --update

leak:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Ruby
uses: actions/setup-ruby@v1
with:
ruby-version: 2.6.x

- name: Install bundler-leak
run: gem install bundler-leak

- name: Run bundler-leak
run: bundle exec bundle leak check --update
2 changes: 2 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
inherit_from: .rubocop_todo.yml

AllCops:
Include:
- 'app/**/*.rb'
Expand Down
55 changes: 55 additions & 0 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-11-14 16:14:11 UTC using RuboCop version 0.92.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

# Offense count: 1
# Cop supports --auto-correct.
Layout/EmptyLines:
Exclude:
- 'config/environments/development.rb'

# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Layout/LineLength:
Max: 112

# Offense count: 2
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBrackets.
# SupportedStyles: space, no_space, compact
# SupportedStylesForEmptyBrackets: space, no_space
Layout/SpaceInsideArrayLiteralBrackets:
Exclude:
- 'config/environments/production.rb'

# Offense count: 17
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Enabled: false

# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Style/StringLiterals:
Exclude:
- 'config/environments/development.rb'
- 'config/environments/production.rb'
- 'config/environments/test.rb'
- 'config/puma.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: .
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: percent
MinSize: 3
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ruby-2.6.3
2.6.5
15 changes: 0 additions & 15 deletions .travis.yml

This file was deleted.

12 changes: 11 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.3'
ruby '2.6.5'

gem 'rails', '~> 5.2.3'
gem 'pg', '>= 0.18', '< 2.0'
Expand All @@ -12,7 +12,16 @@ gem 'devise_invitable', '~> 2.0.0'
gem 'fast_jsonapi'
gem 'carrierwave', '~> 2.0'

# Inspection
gem 'rubocop', '~> 0.92.0', require: false
gem 'rubocop-performance', '~> 1.8.1', require: false
gem 'rubocop-rails', '~> 2.8.1', require: false
gem 'rubocop-rake', '~> 0.5.1', require: false
gem 'rubocop-rspec', '~> 1.43.2', require: false

group :development, :test do
gem 'bundler-audit'
gem 'bundler-leak', '~> 0.2.0'
gem 'pry-byebug'
gem 'rspec-rails', '~> 3.8'
gem 'factory_bot_rails'
Expand All @@ -22,6 +31,7 @@ end

group :development do
gem 'annotate'
gem 'brakeman', '~> 4.10.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
Expand Down
50 changes: 48 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,18 @@ GEM
activerecord (>= 3.2, < 7.0)
rake (>= 10.4, < 13.0)
arel (9.0.0)
ast (2.4.1)
bcrypt (3.1.13)
bootsnap (1.4.5)
msgpack (~> 1.0)
brakeman (4.10.0)
builder (3.2.3)
bundler-audit (0.7.0.1)
bundler (>= 1.2.0, < 3)
thor (>= 0.18, < 2)
bundler-leak (0.2.0)
bundler (>= 1.2.0, < 3)
thor (>= 0.18, < 2)
byebug (11.0.1)
carrierwave (2.0.1)
activemodel (>= 5.0.0)
Expand Down Expand Up @@ -139,6 +147,9 @@ GEM
nokogiri (1.10.4)
mini_portile2 (~> 2.4.0)
orm_adapter (0.5.0)
parallel (1.20.0)
parser (2.7.2.0)
ast (~> 2.4.1)
pg (1.1.4)
pry (0.12.2)
coderay (~> 1.1.0)
Expand Down Expand Up @@ -175,13 +186,16 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
rake (12.3.3)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
regexp_parser (1.8.2)
responders (3.0.0)
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.4)
rspec-core (3.8.2)
rspec-support (~> 3.8.0)
rspec-expectations (3.8.4)
Expand All @@ -199,6 +213,29 @@ GEM
rspec-mocks (~> 3.8.0)
rspec-support (~> 3.8.0)
rspec-support (3.8.2)
rubocop (0.92.0)
parallel (~> 1.10)
parser (>= 2.7.1.5)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.7)
rexml
rubocop-ast (>= 0.5.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 2.0)
rubocop-ast (1.1.1)
parser (>= 2.7.1.5)
rubocop-performance (1.8.1)
rubocop (>= 0.87.0)
rubocop-ast (>= 0.4.0)
rubocop-rails (2.8.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 0.87.0)
rubocop-rake (0.5.1)
rubocop
rubocop-rspec (1.43.2)
rubocop (~> 0.87)
ruby-progressbar (1.10.1)
ruby-vips (2.0.15)
ffi (~> 1.9)
ruby_dep (1.5.0)
Expand All @@ -222,6 +259,7 @@ GEM
tilt (2.0.9)
tzinfo (1.2.5)
thread_safe (~> 0.1)
unicode-display_width (1.7.0)
warden (1.2.8)
rack (>= 2.0.6)
websocket-driver (0.7.1)
Expand All @@ -234,6 +272,9 @@ PLATFORMS
DEPENDENCIES
annotate
bootsnap (>= 1.1.0)
brakeman (~> 4.10.0)
bundler-audit
bundler-leak (~> 0.2.0)
carrierwave (~> 2.0)
database_cleaner
devise_invitable (~> 2.0.0)
Expand All @@ -248,12 +289,17 @@ DEPENDENCIES
puma (~> 3.11)
rails (~> 5.2.3)
rspec-rails (~> 3.8)
rubocop (~> 0.92.0)
rubocop-performance (~> 1.8.1)
rubocop-rails (~> 2.8.1)
rubocop-rake (~> 0.5.1)
rubocop-rspec (~> 1.43.2)
spring
spring-watcher-listen (~> 2.0.0)
tzinfo-data

RUBY VERSION
ruby 2.6.3p62
ruby 2.6.5p114

BUNDLED WITH
2.0.2
2.1.4
Loading