-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
63 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,69 @@ | ||
# Ruby CircleCI 2.0 configuration file | ||
# | ||
# Check https://circleci.com/docs/2.0/language-ruby/ for more details | ||
# | ||
version: 2 | ||
jobs: | ||
build: | ||
working_directory: ~/enju_search_log | ||
docker: | ||
- image: circleci/ruby:2.4 | ||
environment: | ||
BUNDLE_JOBS: 3 | ||
BUNDLE_PATH: vendor/bundle | ||
PGHOST: 127.0.0.1 | ||
PGUSER: postgres | ||
- image: circleci/postgres:9.6-alpine | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: enju_search_log_dummy_test | ||
# specify the version you desire here | ||
- image: circleci/ruby:2.5-node-browsers | ||
environment: | ||
PGHOST: 127.0.0.1 | ||
PGUSER: postgres | ||
|
||
# Specify service dependencies here if necessary | ||
# CircleCI maintains a library of pre-built images | ||
# documented at https://circleci.com/docs/2.0/circleci-images/ | ||
- image: circleci/postgres:10 | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: enju_search_log_dummy_test | ||
|
||
working_directory: ~/repo | ||
|
||
steps: | ||
- checkout | ||
|
||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- rails-demo-bundle-v2-{{ checksum "Gemfile.lock" }} | ||
- rails-demo-bundle-v2- | ||
- run: bundle update | ||
- v1-dependencies-{{ checksum "Gemfile.lock" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v1-dependencies- | ||
|
||
- run: | ||
command: dockerize -wait tcp://localhost:5432 -timeout 1m | ||
- run: | ||
command: sudo apt install -y openjdk-8-jre-headless | ||
- run: bundle exec rake db:create RAILS_ENV=test | ||
- run: bundle exec rake db:migrate RAILS_ENV=test | ||
- run: bundle exec rake app:sunspot:solr:start RAILS_ENV=test | ||
- run: bundle exec rake | ||
name: install dependencies | ||
command: | | ||
bundle install --jobs=4 --retry=3 --path vendor/bundle | ||
- save_cache: | ||
key: rails-demo-bundle-v2-{{ checksum "Gemfile.lock" }} | ||
paths: | ||
- vendor/bundle | ||
- ./vendor/bundle | ||
key: v1-dependencies-{{ checksum "Gemfile.lock" }} | ||
|
||
# Database setup | ||
- run: | ||
command: dockerize -wait tcp://localhost:5432 -timeout 1m | ||
- run: bundle exec rake db:create | ||
- run: bundle exec rake db:schema:load | ||
|
||
# run tests! | ||
- run: | ||
name: run tests | ||
command: | | ||
mkdir /tmp/test-results | ||
TEST_FILES="$(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings)" | ||
bundle exec rspec --format progress \ | ||
--format RspecJunitFormatter \ | ||
--out /tmp/test-results/rspec.xml \ | ||
--format progress \ | ||
$TEST_FILES | ||
# collect reports | ||
- store_test_results: | ||
path: /tmp/test-results | ||
- store_artifacts: | ||
path: /tmp/test-results | ||
destination: test-results |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module EnjuSearchLog | ||
VERSION = "0.3.0" | ||
VERSION = "0.3.1" | ||
end |