From 0bc63df9ea0043f3c044b70f7c930cdcd671e46c Mon Sep 17 00:00:00 2001 From: Robb Kidd Date: Fri, 5 Oct 2018 19:56:19 -0600 Subject: [PATCH 1/3] less docker-in-docker action Configure Travis test run to use the PostgreSQL and Redis services already available in the Travis CI environment. Signed-off-by: Robb Kidd --- .travis.yml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7cf89219..23fb457a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,21 @@ -# Since we build and test in Docker we dont -# need node at build time -language: c +sudo: false +language: ruby +bundler_args: "--jobs 7" -services: - - docker +cache: + bundler: true -script: - - make build - - | - while ! psql --host=localhost --username=postgres -c 'SELECT 1'> /dev/null 2>&1; do - echo 'Waiting for postgres...' - sleep 1; - done; - - make test - - if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then make upgrade; fi +services: + - redis-server + - postgresql env: secure: "AmnH0r1tF9HIVsUfhoJHzCEqTZz3TU4FUd2D+T0XzSDbz6kUSubmP4agYRsJI1xPTwegqSonwL0QGAlaIKEssz6rqAqBSvzHC95XvghP1HVVp2/j8vvFaJbpWsnTQ25FbMgDD89wHRKRs0qk2Ui0zi+CtNFylj83D13yoVys6C0=" + +before_script: + - psql -c 'create database operationcode_test;' -U postgres + +script: + - bundle exec rails db:migrate RAILS_ENV=test + - bundle exec rake test + - bundle exec rubocop From 4fd3109bd444f1ce14e20ac4c6e1fa7fa2eb9f3e Mon Sep 17 00:00:00 2001 From: Robb Kidd Date: Wed, 10 Oct 2018 11:37:38 -0400 Subject: [PATCH 2/3] only build pushes to the master branch Branches in pull requests will still be built by virtue of being associated with a pull request. Restricting "branches" to "only master" will prevent duplicate web hook firing to Travis. Signed-off-by: Robb Kidd --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 23fb457a..01fc021d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ sudo: false +branches: + only: + - master language: ruby bundler_args: "--jobs 7" From 8bb7f49af1fa55975a073618c4051b614fd14631 Mon Sep 17 00:00:00 2001 From: Robb Kidd Date: Wed, 10 Oct 2018 16:01:45 -0400 Subject: [PATCH 3/3] WIP: debug rubocop (do not merge) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 01fc021d..bf514da5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,4 +21,4 @@ before_script: script: - bundle exec rails db:migrate RAILS_ENV=test - bundle exec rake test - - bundle exec rubocop + - bundle exec rubocop -d