diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index a86f5f6..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,65 +0,0 @@ -# - '2.1' -# - '2.2' -# - '2.3' -# - '2.4' -# - '2.5' -# - 'ruby-head' -# - 'jruby' - -version: 2 -workflows: - version: 2 - test: - jobs: - - test-2.1 - - test-2.2 - - test-2.3 - - test-2.4 - - test-2.5 - - test-jruby - - test-latest -jobs: - test-2.1: &test-template - docker: - - image: circleci/ruby:2.1 - working_directory: ~/repo - steps: - - checkout - - run: # Install Ruby dependencies - name: Bundle Install - command: bundle check || bundle install - - run: - name: Run rspec in parallel - command: | - bundle exec rspec --profile 10 \ - --format RspecJunitFormatter \ - --out test_results/rspec.xml \ - --format progress - - store_test_results: - path: test_results - test-2.2: - <<: *test-template - docker: - - image: circleci/ruby:2.2 - test-2.3: - <<: *test-template - docker: - - image: circleci/ruby:2.3 - test-2.4: - <<: *test-template - docker: - - image: circleci/ruby:2.4 - test-2.5: - <<: *test-template - docker: - - image: circleci/ruby:2.5 - test-jruby: - <<: *test-template - docker: - - image: circleci/jruby:latest - environment: - JRUBY_OPTS: "--debug" - test-latest: - <<: *test-template - docker: - - image: circleci/ruby:latest diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..6a9a741 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,38 @@ +name: Ruby + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: [2.6, 2.7, '3.0', 3.1, head, jruby, jruby-head] + env: + JRUBY_OPTS: "--debug" + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + - name: Install dependencies + run: bundle install + - name: Run tests + run: bundle exec rake spec + - name: Coveralls Parallel + uses: coverallsapp/github-action@1.1.3 + with: + github-token: ${{ secrets.github_token }} + flag-name: run-${{ matrix.ruby-version }} + parallel: true + + finish: + needs: test + runs-on: ubuntu-latest + steps: + - name: Coveralls Finished + uses: coverallsapp/github-action@1.1.3 + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true diff --git a/.rspec b/.rspec index 5052887..34c5164 100644 --- a/.rspec +++ b/.rspec @@ -1 +1,3 @@ ---color \ No newline at end of file +--format documentation +--color +--require spec_helper diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index db7467a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: ruby -cache: - directories: - - vendor/bundle -sudo: false -rvm: - - '1.9' - - '2.1' - - '2.2' - - '2.3' - - '2.4' - - '2.5' - - 'ruby-head' - - 'jruby' - -install: bundle install --jobs=3 --retry=3 - -script: bundle exec rake spec - -after_success: - coveralls diff --git a/Gemfile b/Gemfile index 8114ff4..c618f84 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,6 @@ source 'https://rubygems.org' gemspec -platforms :ruby do - gem 'coveralls', require: false -end + +gem 'simplecov', require: false +gem 'simplecov-lcov', require: false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 62bcf6b..4ea048f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,14 +1,15 @@ + require 'simplecov' -begin - require 'coveralls' -rescue LoadError - puts 'Running on Jruby' -end +require 'simplecov-lcov' -Coveralls.wear! if defined? Coveralls +SimpleCov::Formatter::LcovFormatter.config do |config| + config.report_with_single_file = true + config.single_report_path = 'coverage/lcov.info' +end +SimpleCov.formatters = SimpleCov::Formatter::LcovFormatter SimpleCov.start do - add_filter '/spec/' + add_filter 'spec/' end RSpec.configure do |c|