From b81375cb382be716487e63a452af8555c87fe9b8 Mon Sep 17 00:00:00 2001 From: Guilherme Souza <101073+guilhermef@users.noreply.github.com> Date: Mon, 24 Jan 2022 16:59:54 +0100 Subject: [PATCH] Switch to Github Actions --- .circleci/config.yml | 65 -------------------------------------- .github/workflows/main.yml | 38 ++++++++++++++++++++++ .rspec | 4 ++- .travis.yml | 21 ------------ Gemfile | 6 ++-- README.rdoc | 2 +- spec/spec_helper.rb | 12 ++++--- 7 files changed, 52 insertions(+), 96 deletions(-) delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/main.yml delete mode 100644 .travis.yml 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/README.rdoc b/README.rdoc index b65d90a..5278900 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,4 +1,4 @@ -= ruby-thumbor {Build Status}[http://travis-ci.org/thumbor/ruby-thumbor] {Gem Version}[http://badge.fury.io/rb/ruby-thumbor] {Coverage Status}[https://coveralls.io/github/thumbor/ruby-thumbor?branch=master] {CircleCI}[https://circleci.com/gh/thumbor/ruby-thumbor] += ruby-thumbor {Build Status}[https://github.com/thumbor/ruby-thumbor/actions] {Gem Version}[http://badge.fury.io/rb/ruby-thumbor] {Coverage Status}[https://coveralls.io/github/thumbor/ruby-thumbor?branch=master] * http://github.com/thumbor/ruby-thumbor diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 62bcf6b..8830efb 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,11 +1,13 @@ + require 'simplecov' -begin - require 'coveralls' -rescue LoadError - puts 'Running on Jruby' +require 'simplecov-lcov' + +SimpleCov::Formatter::LcovFormatter.config do |config| + config.report_with_single_file = true + config.single_report_path = 'coverage/lcov.info' end -Coveralls.wear! if defined? Coveralls +SimpleCov.formatters = SimpleCov::Formatter::LcovFormatter SimpleCov.start do add_filter '/spec/'