Skip to content

Commit

Permalink
Merge pull request #819 from kevinhughes27/fix-ci
Browse files Browse the repository at this point in the history
fix ci
  • Loading branch information
kevinhughes27 authored Jul 28, 2018
2 parents af28794 + e88b0df commit f82cc06
Show file tree
Hide file tree
Showing 9 changed files with 483 additions and 830 deletions.
41 changes: 27 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ version: 2

jobs:
build:
working_directory: ~/ut

docker:
- image: circleci/ruby:2.5.1-node-browsers
- image: circleci/postgres:9.4.12-alpine
Expand All @@ -13,6 +11,7 @@ jobs:
PGUSER: ubuntu
RAILS_ENV: test
RACK_ENV: test
GENERATE_SOURCEMAP: false

steps:
# Checkout the source code
Expand All @@ -21,37 +20,43 @@ jobs:

# Restore bundle cache
- type: cache-restore
key: gemfile-{{ checksum "Gemfile.lock" }}
key: Gemfile-{{ checksum "Gemfile.lock" }}

# Bundle install dependencies
- run: bundle install --with circleci --without production --without development --path vendor/bundle
- run: bundle install --with ci --without production --without development --path vendor/bundle

# Store bundle cache
- type: cache-save
key: gemfile-{{ checksum "Gemfile.lock" }}
key: Gemfile-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle

# Restore yarn cache
- restore_cache:
key: yarn-{{ checksum "yarn.lock" }}
key: |
yarn
{{ checksum "yarn.lock" }}
{{ checksum "client/yarn.lock" }}
{{ checksum "clients/admin_next/yarn.lock" }}
{{ checksum "clients/player_app/yarn.lock" }}
# Yarn install dependencies
- run: yarn install

# Store yarn cache
- save_cache:
key: yarn-{{ checksum "yarn.lock" }}
key: |
yarn
{{ checksum "yarn.lock" }}
{{ checksum "client/yarn.lock" }}
{{ checksum "clients/admin_next/yarn.lock" }}
{{ checksum "clients/player_app/yarn.lock" }}
paths:
- ./node_modules
- ./client/node_modules
- ./clients/player_app/node_modules
- ./clients/admin_next/node_modules

# Database setup
- run: bundle exec rake db:create
- run: bundle exec rake db:schema:load

# Generate checksum for assets
- type: shell
command: |
Expand Down Expand Up @@ -81,7 +86,7 @@ jobs:
- tmp/cache/assets

# Build admin_next
- run: cd clients/admin_next && DEBUG=babel yarn build &> /dev/null
- run: cd clients/admin_next && npm run build
- run: cd clients/admin_next && yarn type-check

# Generate checksum for player_app
Expand All @@ -102,14 +107,22 @@ jobs:
paths:
- clients/player_app/build

# Database setup
- run: bundle exec rake db:create
- run: bundle exec rake db:schema:load

# Run tests
- run: bundle exec rake ci:all

# Store Artifacts
- store_artifacts:
path: ~/ut/tmp/coverage
path: ~/project/tmp/coverage
destination: coverage

- store_artifacts:
path: ~/ut/tmp/capybara
path: ~/project/tmp/capybara
destination: capybara

- store_artifacts:
path: /home/circleci/.npm/_logs
destination: npm
55 changes: 55 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
language: node_js
node_js: 8.11.3

addons:
postgresql: 9.4
chrome: stable
artifacts:
paths:
- $HOME/tmp/coverage
- $HOME/tmp/capybara

services:
- redis-server

cache:
bundler: true
directories:
- /home/travis/.rvm/
- /node_modules
- /client/node_modules
- /clients/admin_next/node_modules
- /clients/player_app/node_modules

env:
RAILS_ENV: test
RACK_ENV: test
GENERATE_SOURCEMAP: false

before_install:
- rvm install 2.5.1
- gem install bundler
- wget -N http://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip -P ~/
- unzip ~/chromedriver_linux64.zip -d ~/
- rm ~/chromedriver_linux64.zip
- sudo mv -f ~/chromedriver /usr/local/share/
- sudo chmod +x /usr/local/share/chromedriver
- sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver

install:
- bundle install --with ci --without production --without development
- yarn install
- bundle exec rake assets:precompile
- cd clients/admin_next && yarn build && cd ../..
- cd clients/player_app && yarn build && cd ../..

before_script:
- bundle exec rake db:create
- bundle exec rake db:schema:load

script:
- cd clients/admin_next && yarn type-check && cd ../..
- bundle exec rake ci:all

notifications:
email: false
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ gem 'bootsnap'
gem 'puma'
gem 'config'
gem 'jbuilder'
gem 'tzinfo-data'
gem 'active_operation'

# api
Expand Down Expand Up @@ -98,8 +99,8 @@ group :test do
gem 'json-schema', '~> 2.6.0'
end

group :circleci do
group :ci do
gem 'minitest-retry'
gem 'minitest-ci', git: 'git@github.com:circleci/minitest-ci.git'
gem 'minitest-ci'
gem 'bundler-audit', require: false
end
59 changes: 28 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
GIT
remote: git@github.com:circleci/minitest-ci.git
revision: 8b72b0f32f154d91b53d63d1d0a8a8fb3b01d726
specs:
minitest-ci (3.4.0)
minitest (>= 5.0.6)

GIT
remote: https://github.com/amatsuda/kaminari
revision: 9e9ac3b7516b409a4aed1ce1bc6c5e90108c9511
revision: a43335cc31b765f2e5a9fb0d8694fa707a6593c6
specs:
kaminari (1.1.1)
activesupport (>= 4.1.0)
Expand Down Expand Up @@ -60,7 +53,7 @@ GEM
activemodel (= 5.2.0)
activesupport (= 5.2.0)
arel (>= 9.0)
activerecord-import (0.23.0)
activerecord-import (0.25.0)
activerecord (>= 3.2)
activestorage (5.2.0)
actionpack (= 5.2.0)
Expand All @@ -75,11 +68,11 @@ GEM
arel (9.0.0)
auto_strip_attributes (2.4.0)
activerecord (>= 4.0)
autoprefixer-rails (8.6.2)
autoprefixer-rails (9.0.0)
execjs
bcrypt (3.1.12)
bindex (0.5.0)
bootsnap (1.3.0)
bootsnap (1.3.1)
msgpack (~> 1.0)
bootstrap-sass (3.3.7)
autoprefixer-rails (>= 5.2.1)
Expand All @@ -92,7 +85,7 @@ GEM
bundler (~> 1.2)
thor (~> 0.18)
byebug (9.0.6)
capybara (3.2.1)
capybara (3.4.2)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
Expand Down Expand Up @@ -126,16 +119,16 @@ GEM
responders
warden (~> 1.2.3)
docile (1.3.1)
dotenv (2.4.0)
dotenv-rails (2.4.0)
dotenv (= 2.4.0)
dotenv (2.5.0)
dotenv-rails (2.5.0)
dotenv (= 2.5.0)
railties (>= 3.2, < 6.0)
dry-configurable (0.7.0)
concurrent-ruby (~> 1.0)
dry-container (0.6.0)
concurrent-ruby (~> 1.0)
dry-configurable (~> 0.1, >= 0.1.3)
dry-core (0.4.6)
dry-core (0.4.7)
concurrent-ruby (~> 1.0)
dry-equalizer (0.2.1)
dry-inflector (0.1.2)
Expand All @@ -150,7 +143,7 @@ GEM
dry-equalizer (~> 0.2)
dry-inflector (~> 0.1, >= 0.1.2)
dry-logic (~> 0.4, >= 0.4.2)
dry-validation (0.12.0)
dry-validation (0.12.1)
concurrent-ruby (~> 1.0)
dry-configurable (~> 0.1, >= 0.1.3)
dry-core (~> 0.2, >= 0.2.1)
Expand All @@ -164,7 +157,7 @@ GEM
factory_bot_rails (4.10.0)
factory_bot (~> 4.10.0)
railties (>= 3.0.0)
faker (1.8.7)
faker (1.9.1)
i18n (>= 0.7)
faraday (0.12.2)
multipart-post (>= 1.2, < 3)
Expand All @@ -176,10 +169,10 @@ GEM
multi_json (>= 1.11.0)
globalid (0.4.1)
activesupport (>= 4.2.0)
graphiql-rails (1.4.10)
graphiql-rails (1.4.11)
railties
sprockets-rails
graphql (1.8.2)
graphql (1.8.5)
hashie (3.5.7)
i18n (1.0.1)
concurrent-ruby (~> 1.0)
Expand Down Expand Up @@ -223,9 +216,11 @@ GEM
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
minitest-ci (3.4.0)
minitest (>= 5.0.6)
minitest-retry (0.1.9)
minitest (>= 5.0)
mocha (1.5.0)
mocha (1.6.0)
metaclass (~> 0.0.1)
msgpack (1.2.4)
multi_json (1.13.1)
Expand Down Expand Up @@ -258,14 +253,14 @@ GEM
paranoia (2.4.1)
activerecord (>= 4.0, < 5.3)
pg (0.21.0)
phonelib (0.6.22)
puma (3.11.4)
phonelib (0.6.23)
puma (3.12.0)
rack (2.0.5)
rack-protection (2.0.3)
rack
rack-proxy (0.6.4)
rack
rack-test (1.0.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rack-timeout (0.5.1)
rails (5.2.0)
Expand Down Expand Up @@ -312,17 +307,16 @@ GEM
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
rollbar (2.16.2)
rollbar (2.16.3)
multi_json
ruby_dep (1.5.0)
rubyzip (1.2.1)
sass (3.5.6)
sass (3.5.7)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (1.11.4)
bundler
sassc (1.12.1)
ffi (~> 1.9.6)
sass (>= 3.3.0)
sassc-rails (1.3.0)
Expand All @@ -332,7 +326,7 @@ GEM
sprockets (> 2.11)
sprockets-rails
tilt
selenium-webdriver (3.12.0)
selenium-webdriver (3.13.1)
childprocess (~> 0.5)
rubyzip (~> 1.2)
sidekiq (5.1.3)
Expand Down Expand Up @@ -371,6 +365,8 @@ GEM
railties
tzinfo (1.2.5)
thread_safe (~> 0.1)
tzinfo-data (1.2018.5)
tzinfo (>= 1.0.0)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
uniform_notifier (1.11.0)
Expand All @@ -381,7 +377,7 @@ GEM
activemodel (>= 5.0)
bindex (>= 0.4.0)
railties (>= 5.0)
webpacker (3.5.3)
webpacker (3.5.5)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
Expand Down Expand Up @@ -429,7 +425,7 @@ DEPENDENCIES
launchy
letter_opener
listen
minitest-ci!
minitest-ci
minitest-retry
mocha
newrelic_rpm
Expand All @@ -454,6 +450,7 @@ DEPENDENCIES
spring
turbolinks (~> 5.0.0)
twine-rails
tzinfo-data
uglifier (~> 3.2.0)
web-console
webpacker
Expand Down
5 changes: 3 additions & 2 deletions app/controllers/admin/divisions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ def update
confirm
message
userErrors { field message }
division { id name numTeams numDays bracketType }
division { id name numTeams numDays bracket { handle }}
}"
)

@division = Division.new(result_to_attributes(result, 'division'))
@division = Division.new(result_to_attributes(result, 'division', except: 'bracket'))
@division.bracket_type = result['division']['bracket']['handle']
@errors = result_to_errors(result)

if result['success']
Expand Down
Loading

0 comments on commit f82cc06

Please sign in to comment.