Skip to content

Commit

Permalink
Merge branch 'master' into stages/rc-2018-04-12
Browse files Browse the repository at this point in the history
  • Loading branch information
monfresh committed Apr 9, 2018
2 parents b148f90 + de8c3e9 commit 4986f22
Show file tree
Hide file tree
Showing 37 changed files with 851 additions and 284 deletions.
59 changes: 45 additions & 14 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
version: 2
jobs:
build:
parallelism: 4
docker:
# Specify the Ruby version you desire here
- image: circleci/ruby:2.3.6-node-browsers
- image: circleci/ruby:2.3-node-browsers
environment:
RAILS_ENV: test
CC_TEST_REPORTER_ID: faecd27e9aed532634b3f4d3e251542d7de9457cfca96a94208a63270ef9b42e
COVERAGE: true
PATH: "/opt/yarn/yarn-v1.5.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
Expand All @@ -28,35 +30,59 @@ jobs:
- checkout

- restore-cache:
key: identity-idp-{{ checksum "Gemfile.lock" }}

keys:
- identity-idp-bundle-{{ checksum "Gemfile.lock" }}
- identity-idp-bundle-
- run:
name: Install dependencies
command: |
gem install bundler
bundle install --deployment --jobs=4 --retry=3 --without deploy development doc production --path vendor/bundle
bundle check || bundle install --deployment --jobs=4 --retry=3 --without deploy development doc production --path vendor/bundle
- save-cache:
key: identity-idp-bundle-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle

- restore-cache:
keys:
- identity-idp-yarn-{{ checksum "yarn.lock" }}
- identity-idp-yarn-
- run:
name: Install Yarn
command: yarn install --cache-folder ~/.cache/yarn
- save-cache:
key: identity-idp-yarn-{{ checksum "yarn.lock" }}
paths:
- ~/.cache/yarn

- run:
name: Install phantomjs
command: |
sudo curl --output /tmp/phantomjs https://s3.amazonaws.com/circle-downloads/phantomjs-2.1.1
sudo chmod ugo+x /tmp/phantomjs
sudo ln -sf /tmp/phantomjs /usr/local/bin/phantomjs
- run:
name: Install AWS CLI
command: |
sudo apt-get update
sudo apt-get install python-pip python-dev jq
sudo pip install awscli
- run:
name: Install Code Climate Test Reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
aws s3 --region us-west-2 rm s3://login-gov-test-coverage/coverage/$CIRCLE_PREVIOUS_BUILD_NUM --recursive
# Store bundle cache
- save-cache:
key: identity-idp-{{ checksum "Gemfile.lock" }}
paths:
- vendor/bundle
- run:
name: Wait for DB
command: dockerize -wait tcp://localhost:5432 -timeout 1m

- run:
name: Test Setup
command: |
yarn install
cp config/application.yml.example config/application.yml
cp certs/saml.crt.example certs/saml.crt
cp certs/saml2018.crt.example certs/saml2018.crt
Expand All @@ -72,19 +98,24 @@ jobs:
mkdir /tmp/test-results
./cc-test-reporter before-build
bundle exec rspec --format progress
bundle exec rake knapsack:rspec
yarn test
bundle exec slim-lint app/views
- run:
name: Upload Test Results to Code Climate
name: Code Climate Test Coverage
command: |
./cc-test-reporter format-coverage -t simplecov $CIRCLE_ARTIFACTS/coverage/.resultset.json
./cc-test-reporter upload-coverage
./cc-test-reporter format-coverage -t simplecov -o "coverage/codeclimate.$CIRCLE_NODE_INDEX.json"
aws s3 sync coverage/ "s3://login-gov-test-coverage/coverage/$CIRCLE_BUILD_NUM"
# collect reports
- store_test_results:
path: /tmp/test-results
- store_artifacts:
path: /tmp/test-results
destination: test-results

- deploy:
command: |
aws s3 sync "s3://login-gov-test-coverage/coverage/$CIRCLE_BUILD_NUM" coverage/
./cc-test-reporter sum-coverage --output - --parts $CIRCLE_NODE_TOTAL coverage/codeclimate.*.json | ./cc-test-reporter upload-coverage --input -
1 change: 1 addition & 0 deletions .reek
Original file line number Diff line number Diff line change
Expand Up @@ -178,3 +178,4 @@ UtilityFunction:
enabled: false
exclude_paths:
- db/migrate
- spec
11 changes: 6 additions & 5 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ AllCops:
- '**/Capfile'
Exclude:
- 'db/schema.rb'
- 'bin/**/*'
- 'config/initializers/devise.rb'
- 'db/migrate/*'
- 'spec/services/pii/nist_encryption_spec.rb'
- 'node_modules/**/*'
- 'lib/rspec/user_flow_formatter.rb'
- 'lib/user_flow_exporter.rb'
- 'node_modules/**/*'
- 'scripts/load_testing/*'
- 'spec/**/*'
- 'tmp/**/*'
- 'bin/**/*'
- 'db/migrate/*'
TargetRubyVersion: 2.3
TargetRailsVersion: 5.1
UseCache: true
Expand Down
5 changes: 3 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source 'https://rubygems.org'
git_source(:github) { |repo_name| "https://github.com/#{repo_name}.git" }

ruby '~> 2.3.5'
ruby '~> 2.3.7'

gem 'rails', '~> 5.1.3'

Expand Down Expand Up @@ -74,13 +74,14 @@ group :development do
gem 'rack-mini-profiler', require: false
gem 'rails-erd'
gem 'reek'
gem 'rubocop', require: false
gem 'rubocop', '~> 0.52.0', require: false
end

group :development, :test do
gem 'bullet'
gem 'front_matter_parser'
gem 'i18n-tasks'
gem 'knapsack'
gem 'pry-byebug'
gem 'rspec-rails', '~> 3.5.2'
gem 'slim_lint'
Expand Down
Loading

0 comments on commit 4986f22

Please sign in to comment.