defaults: &defaults working_directory: ~/repo environment: JRUBY_OPTS: -J-Xmx1024M version: 2 jobs: build-jruby-1.7.26: <<: *defaults docker: - image: killbill/kbbuild:0.5.0 steps: - checkout - restore_cache: key: v4-dependencies-jruby-1.7.26-{{ .Branch }}-{{ checksum "Gemfile.lock" }} - run: name: Install gem dependencies command: | bundle install --jobs=4 --retry=3 --path=vendor/bundle bundle exec jbundle install - save_cache: paths: - ~/.m2 - .bundle - .jbundler - vendor/bundle key: v4-dependencies-jruby-1.7.26-{{ .Branch }}-{{ checksum "Gemfile.lock" }} test-mysql-jruby-1.7.26: <<: *defaults docker: - image: killbill/kbbuild:0.5.0 - image: killbill/mariadb:0.19 environment: - MYSQL_ROOT_PASSWORD=root steps: - checkout - restore_cache: key: v4-dependencies-jruby-1.7.26-{{ .Branch }}-{{ checksum "Gemfile.lock" }} - run: name: Setup DDL command: | set +e count=0 until mysqladmin ping -h 127.0.0.1 -u root --password=root --silent; do if [[ "$count" == "25" ]]; then exit 1 fi (( count++ )) printf '.' sleep 5 done set -e mysql -h 127.0.0.1 -u root --password=root -e 'create database killbill_test;' - run: name: Run tests command: | mkdir /tmp/test-results AR_ADAPTER='mariadb' AR_USERNAME='root' AR_PASSWORD='' AR_DATABASE='killbill_test' bundle exec rake test:spec | tee /tmp/test-results/test.txt 2>&1 AR_ADAPTER='mariadb' AR_USERNAME='root' AR_PASSWORD='' AR_DATABASE='killbill_test' bundle exec rake test:remote:spec | tee /tmp/test-results/remote-test.txt 2>&1 - store_test_results: path: /tmp/test-results - store_artifacts: path: /tmp/test-results destination: test-results test-postgresql-jruby-1.7.26: <<: *defaults docker: - image: killbill/kbbuild:0.5.0 - image: killbill/postgresql:0.19 environment: - POSTGRES_PASSWORD=postgres steps: - checkout - restore_cache: key: v4-dependencies-jruby-1.7.26-{{ .Branch }}-{{ checksum "Gemfile.lock" }} - run: name: Setup DDL command: | set +e count=0 until $(psql -h 127.0.0.1 -U postgres -p 5432 -l > /dev/null); do if [[ "$count" == "25" ]]; then exit 1 fi (( count++ )) printf '.' sleep 5 done set -e psql -h 127.0.0.1 -U postgres -p 5432 -c 'create database killbill_test;' - run: name: Run tests command: | mkdir /tmp/test-results AR_ADAPTER='postgresql' AR_USERNAME='postgres' AR_DATABASE='killbill_test' bundle exec rake test:spec | tee /tmp/test-results/test.txt 2>&1 AR_ADAPTER='postgresql' AR_USERNAME='postgres' AR_DATABASE='killbill_test' bundle exec rake test:remote:spec | tee /tmp/test-results/remote-test.txt 2>&1 - store_test_results: path: /tmp/test-results - store_artifacts: path: /tmp/test-results destination: test-results test-h2-jruby-1.7.26: <<: *defaults docker: - image: killbill/kbbuild:0.5.0 steps: - checkout - restore_cache: key: v4-dependencies-jruby-1.7.26-{{ .Branch }}-{{ checksum "Gemfile.lock" }} - run: name: Run tests command: | mkdir /tmp/test-results AR_ADAPTER='sqlite3' AR_DATABASE='test.db' bundle exec rake test:spec | tee /tmp/test-results/test.txt 2>&1 AR_ADAPTER='sqlite3' AR_DATABASE='test.db' bundle exec rake test:remote:spec | tee /tmp/test-results/remote-test.txt 2>&1 - store_test_results: path: /tmp/test-results - store_artifacts: path: /tmp/test-results destination: test-results workflows: version: 2 build-and-test: jobs: - build-jruby-1.7.26 #- test-mysql-jruby-1.7.26: # requires: # - build-jruby-1.7.26 - test-postgresql-jruby-1.7.26: requires: - build-jruby-1.7.26 - test-h2-jruby-1.7.26: requires: - build-jruby-1.7.26