Skip to content

Instantly share code, notes, and snippets.

@TakuyaHarayama
Created September 14, 2017 02:53
Show Gist options
  • Save TakuyaHarayama/eafc612607da7932767ce033db6e9d77 to your computer and use it in GitHub Desktop.
Save TakuyaHarayama/eafc612607da7932767ce033db6e9d77 to your computer and use it in GitHub Desktop.
RailsのCircleCI設定サンプル
machine:
timezone:
Asia/Tokyo
ruby:
version:
2.3.1
hosts:
hogehoge.local: 127.0.0.1
fugafuga.local: 127.0.0.1
dependencies:
cache_directories:
- vendor/bundle
override:
- bundle install --jobs=4 --path=vendor/bundle
database:
pre:
- mv config/database.yml.ci config/database.yml
override:
- bundle exec rake db:create db:schema:load RAILS_ENV=test
- bundle exec rake db:migrate RAILS_ENV=test
test:
pre:
# exec rubocop
- chmod a+x scripts/run-rubocop.sh
- scripts/run-rubocop.sh
# exec rails_best_practices
- bundle exec rails_best_practices --config config/rails_best_practices.yml --format html --output-file $CIRCLE_ARTIFACTS/rails_best_practices.html
# exec brakeman
- bundle exec brakeman -4 -A -w 1 -z -o $CIRCLE_ARTIFACTS/brakeman.html
override:
- bundle exec rspec --format progress --format RspecJunitFormatter -o $CIRCLE_TEST_REPORTS/rspec.xml:
parallel: true
files:
- spec/**/*_spec.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment