Skip to content

Commit

Permalink
Run CircleCI tests with many Rubies (presidentbeef#1336)
Browse files Browse the repository at this point in the history
Move all testing to CircleCI, remove TravisCI
  • Loading branch information
presidentbeef authored Mar 27, 2019
1 parent 21f86ff commit 0b34041
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 53 deletions.
84 changes: 71 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,80 @@
version: 2
version: 2.1
jobs:
build:
branches:
ignore:
- gh-pages
default: &default
docker:
- image: circleci/ruby:2.5.1-stretch-node-browsers
environment:
BUNDLE_JOBS: 4
BUNDLE_RETRY: 3
BUNDLE_PATH: vendor/bundle
parallelism: 4
- image: circleci/ruby:latest
steps:
- checkout
- run: bundle check || bundle install
- run:
command: bundle exec rake
- store_test_results:
path: test-results
test-2-3:
<<: *default
docker:
- image: circleci/ruby:2.3
steps:
- checkout
- attach_workspace:
at: ~/repo/tmp
- run:
name: Download cc-test-reporter
command: |
mkdir -p tmp/
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
chmod +x ./tmp/cc-test-reporter
- run: bundle check || bundle install
- run:
command: |
TESTFILES=$(circleci tests glob "test/tests/*.rb" | circleci tests split --split-by=timings)
bundle exec ruby -e 'ARGV.each {|f| require File.join(".", f) }' -- $TESTFILES
bundle exec rake
./tmp/cc-test-reporter format-coverage -t simplecov -o tmp/codeclimate.json coverage/.resultset.json
- store_test_results:
path: test-results
- persist_to_workspace:
root: tmp
paths:
- codeclimate.json
- cc-test-reporter
test-2-4:
<<: *default
docker:
- image: circleci/ruby:2.4
test-2-5:
<<: *default
docker:
- image: circleci/ruby:2.5
test-2-6:
<<: *default
docker:
- image: circleci/ruby:2.6
test-latest:
<<: *default
docker:
- image: circleci/ruby:latest
test-jruby:
<<: *default
docker:
- image: circleci/jruby:latest
upload-coverage:
<<: *default
working_directory: ~/repo
steps:
- attach_workspace:
at: ~/repo/tmp
- run:
name: Upload coverage results to Code Climate
command: "./tmp/cc-test-reporter upload-coverage -i ./tmp/codeclimate.json"
workflows:
version: 2
tests:
jobs:
- default
- test-2-3
- test-2-4
- test-2-5
- test-2-6
- test-jruby
- upload-coverage:
requires:
- test-2-3
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

4 changes: 1 addition & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,5 @@ source "https://rubygems.org"
gemspec :name => "brakeman"

unless ENV['BM_PACKAGE']
gem "rake", "< 10.2.0"
gem "codeclimate-test-reporter", group: :test, require: nil
gem "json", "< 2.0", group: :test, require: nil # For Ruby 1.9.3 https://github.com/colszowka/simplecov/issues/511
gem "rake"
end
1 change: 1 addition & 0 deletions gem_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ module GemDependencies
def self.dev_dependencies spec
spec.add_development_dependency "minitest"
spec.add_development_dependency "minitest-ci"
spec.add_development_dependency "simplecov"
end

def self.base_dependencies spec
Expand Down

0 comments on commit 0b34041

Please sign in to comment.