Commit dfd3afc

mo <mo.khan@gmail.com>
2018-02-16 23:15:52
scripts to rule them all.
1 parent 5d10b20
bin/cibuild
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# script/cibuild: Setup environment for CI to run tests. This is primarily
+#                 designed to run on the continuous integration server.
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+echo "Started at…"
+date "+%H:%M:%S"
+
+# GC customizations
+export RUBY_GC_MALLOC_LIMIT=79000000
+export RUBY_HEAP_MIN_SLOTS=800000
+export RUBY_HEAP_FREE_MIN=100000
+export RUBY_HEAP_SLOTS_INCREMENT=400000
+export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
+
+gem install bundler --no-ri --no-rdoc
+# run tests
+ruby -v
+bin/test
bin/test
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+# script/test: Run test suite for application. Optionally pass in a path to an
+#              individual test file to run a single test.
+
+
+set -e
+
+cd "$(dirname "$0")/.."
+
+[ -z "$DEBUG" ] || set -x
+
+echo "==> Running setup…"
+date "+%H:%M:%S"
+bin/setup
+
+echo "==> Running tests…"
+date "+%H:%M:%S"
+bundle exec rake spec
.gitlab-ci.yml
@@ -5,11 +5,8 @@ before_script:
   - echo "en_US.UTF-8 UTF-8" > /etc/locale.gen
   - locale-gen
   - export LC_ALL=en_US.UTF-8
-  - ruby -v
-  - which ruby
-  - gem install bundler --no-ri --no-rdoc
   - bundle install --jobs $(nproc) "${FLAGS[@]}"
 
 rspec:
   script:
-    - bundle exec rspec
+    - bin/cibuild
.travis.yml
@@ -1,6 +1,8 @@
 sudo: false
 language: ruby
 rvm:
-  - 2.4.2
-before_install: gem install bundler -v 1.15.4
-script: "bundle exec rspec"
+  - 2.2.9
+  - 2.3.6
+  - 2.4.3
+  - 2.5.0
+script: "bin/cibuild"
Rakefile
@@ -2,5 +2,4 @@ require "bundler/gem_tasks"
 require "rspec/core/rake_task"
 
 RSpec::Core::RakeTask.new(:spec)
-
-task :default => :spec
+task default: :spec