From 30895027e8f25576d3e77177ca5bfc5329d3c7ce 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 | 39 +++++++++++++++++++++++
.rspec | 4 ++-
.ruby-version | 2 +-
.travis.yml | 21 ------------
Gemfile | 6 ++--
README.rdoc | 2 +-
ruby-thumbor.gemspec | 4 ---
spec/spec_helper.rb | 19 ++++++++---
tasks/rspec.rake | 8 ++---
10 files changed, 65 insertions(+), 105 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..f5867f6
--- /dev/null
+++ b/.github/workflows/main.yml
@@ -0,0 +1,39 @@
+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
+ if: ${{ !startsWith(matrix.ruby-version, 'jruby') }}
+ 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/.ruby-version b/.ruby-version
index 73462a5..d48d370 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-2.5.1
+2.6.9
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..578ee99 100644
--- a/Gemfile
+++ b/Gemfile
@@ -2,6 +2,6 @@ source 'https://rubygems.org'
gemspec
-platforms :ruby do
- gem 'coveralls', require: false
-end
+gem 'rspec'
+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 {}[http://travis-ci.org/thumbor/ruby-thumbor] {}[http://badge.fury.io/rb/ruby-thumbor] {}[https://coveralls.io/github/thumbor/ruby-thumbor?branch=master] {}[https://circleci.com/gh/thumbor/ruby-thumbor]
+= ruby-thumbor {}[https://github.com/thumbor/ruby-thumbor/actions] {}[http://badge.fury.io/rb/ruby-thumbor] {}[https://coveralls.io/github/thumbor/ruby-thumbor?branch=master]
* http://github.com/thumbor/ruby-thumbor
diff --git a/ruby-thumbor.gemspec b/ruby-thumbor.gemspec
index 5bc65a4..c4b61d2 100644
--- a/ruby-thumbor.gemspec
+++ b/ruby-thumbor.gemspec
@@ -15,9 +15,5 @@ Gem::Specification.new do |s|
s.homepage = 'http://github.com/thumbor/ruby-thumbor'
s.rdoc_options = ['--main', 'README.rdoc']
s.summary = 'ruby-thumbor is the client to the thumbor imaging service (http://github.com/thumbor/thumbor).'
-
- s.add_development_dependency('rspec')
- s.add_development_dependency('simplecov')
s.add_development_dependency('rake')
- s.add_development_dependency('rspec_junit_formatter')
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 62bcf6b..2227c45 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,16 +1,25 @@
+
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::MultiFormatter[
+ SimpleCov::Formatter::HTMLFormatter,
+ SimpleCov::Formatter::LcovFormatter,
+]
SimpleCov.start do
add_filter '/spec/'
end
+SimpleCov.at_exit do
+ SimpleCov.result.format!
+end
+
RSpec.configure do |c|
c.filter_run :focus => true
c.run_all_when_everything_filtered = true
diff --git a/tasks/rspec.rake b/tasks/rspec.rake
index 8effd47..63a721d 100644
--- a/tasks/rspec.rake
+++ b/tasks/rspec.rake
@@ -1,5 +1,5 @@
-require 'rspec/core/rake_task'
-
-RSpec::Core::RakeTask.new(:spec) do |t|
- t.rspec_opts = "--color "
+begin
+ require 'rspec/core/rake_task'
+ RSpec::Core::RakeTask.new(:spec)
+rescue LoadError
end