From e7d5ecc703de6fc6f5b174655e1e6e52f5e33034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20F=C3=BChrer?= Date: Wed, 4 Dec 2019 16:39:47 +0100 Subject: [PATCH] Update to circleci 2.1 (#25) --- .circleci/config.yml | 49 ++++++++++++++++++++++++++++++++++++++++++++ .gitignore | 5 ++++- circle.yml | 14 ------------- shippable.yml | 28 ------------------------- 4 files changed, 53 insertions(+), 43 deletions(-) create mode 100644 .circleci/config.yml delete mode 100644 circle.yml delete mode 100644 shippable.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..a516093 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,49 @@ + +version: 2.1 +jobs: + build: + parallelism: 4 + docker: # run the steps with Docker + - image: circleci/ruby:2.3 + environment: # environment variables for primary container + BUNDLE_JOBS: 3 + BUNDLE_RETRY: 3 + BUNDLE_PATH: vendor/bundle + RAILS_ENV: test + steps: # a collection of executable commands + - checkout # special step to check out source code to working directory + + # Which version of bundler? + - run: + name: Which bundler? + command: bundle -v + + # Restore bundle cache + # Read about caching dependencies: https://circleci.com/docs/2.0/caching/ + - restore_cache: + keys: + - rocket-library-{{ checksum "Gemfile.lock" }} + - rocket-library- + + - run: # Install Ruby dependencies + name: Bundle Install + command: bundle check --path vendor/bundle || bundle install --deployment + + # Store bundle cache for Ruby dependencies + - save_cache: + key: rrocket-library-{{ checksum "Gemfile.lock" }} + paths: + - vendor/bundle + + - run: + name: Run rspec in parallel + command: | + bundle exec rspec --profile 10 \ + --format JUnit \ + --out $CIRCLE_TEST_REPORTS/rspec.xml \ + --format progress \ + $(circleci tests glob "spec/**/*_spec.rb" | circleci tests split --split-by=timings) + + # Save test results for timing analysis + - store_test_results: # Upload test results for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/ + path: $CIRCLE_TEST_REPORTS \ No newline at end of file diff --git a/.gitignore b/.gitignore index aee469b..1710813 100644 --- a/.gitignore +++ b/.gitignore @@ -23,4 +23,7 @@ .byebug_history # File uploads -public/uploads/* \ No newline at end of file +public/uploads/* + +# Ignore vendor +vendor/* \ No newline at end of file diff --git a/circle.yml b/circle.yml deleted file mode 100644 index c518762..0000000 --- a/circle.yml +++ /dev/null @@ -1,14 +0,0 @@ -machine: - ruby: - version: 2.3.0 - -dependencies: - pre: - - gem install bundler - -test: - override: - - bundle exec rspec --format JUnit --out $CIRCLE_TEST_REPORTS/rspec.xml: - parallel: true - files: - - spec/*/*_spec.rb diff --git a/shippable.yml b/shippable.yml deleted file mode 100644 index 23ead77..0000000 --- a/shippable.yml +++ /dev/null @@ -1,28 +0,0 @@ -# {Rails.root}/shippable.yml -# shippleable example for rails 4 with mysql -language: ruby - -rvm: - - 2.3.0 - -env: - - CI_REPORTS=shippable/testresults COVERAGE_REPORTS=shippable/codecoverage CI_COVERAGE_FORMATTER=csv - -before_install: - - sudo apt-get -y update - - sudo apt-get -y install libpq-dev - - sudo apt-get -y install libgmp-dev - - sudo apt-get -y install libqt4-dev - - sudo apt-get -y install xvfb - - gem install bundler --pre - - bundle update rake - -# ensure the test output and coverage dirs are created -before_script: - - mkdir -p shippable/testresults - - mkdir -p shippable/codecoverage - - RAILS_ENV=test rake db:migrate - -# write the rspec tests to the output dir -script: - - DISPLAY=localhost:1.0 xvfb-run rspec -f JUnit -o shippable/testresults/results.xml