diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..fb49fff --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,25 @@ +name: CI + +on: [push, pull_request] + +jobs: + test: + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + ruby: ["2.5", "2.6", "2.7", "3.0", "3.1", ruby-head, jruby-9.2, jruby-9.3] + rubocop_version: ["0.86", "1.20"] + env: + BUNDLE_GEMFILE: "gemfiles/rubocop_${{ matrix.rubocop_version }}.gemfile" + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true # 'bundle install' and cache gems + ruby-version: ${{ matrix.ruby }} + - name: Run tests + run: bundle exec rspec diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..fb56815 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,19 @@ +name: Lint + +on: [push, pull_request] + +jobs: + lint: + + runs-on: ubuntu-latest + name: Rubocop + + steps: + - uses: actions/checkout@v2 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + bundler-cache: true # 'bundle install' and cache gems + ruby-version: "2.7" + - name: Run Rubocop + run: bundle exec rubocop diff --git a/.rubocop.yml b/.rubocop.yml index c105295..338a541 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,6 @@ AllCops: DisplayCopNames: true - TargetRubyVersion: 2.3 + TargetRubyVersion: 2.5 Lint/RaiseException: Enabled: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0f5b904..0000000 --- a/.travis.yml +++ /dev/null @@ -1,64 +0,0 @@ -cache: bundler -language: ruby -rvm: - - jruby-9.2.9.0 - - 2.3.0 - - 2.4 - - 2.5 - - 2.6 - - 2.7 - - 3.0 - -gemfile: - - gemfiles/rubocop_0.53.gemfile - - gemfiles/rubocop_0.81.gemfile - - gemfiles/rubocop_0.86.gemfile - - gemfiles/rubocop_1.20.gemfile - -script_rubocop: &script_rubocop - - bundle exec rspec - - bundle exec rubocop - -jobs: - fast_finish: true - exclude: - - rvm: 2.3.0 - gemfile: gemfiles/rubocop_0.86.gemfile - - rvm: 2.3.0 - gemfile: gemfiles/rubocop_1.20.gemfile - - rvm: 2.5 - gemfile: gemfiles/rubocop_0.53.gemfile - - rvm: 2.6 - gemfile: gemfiles/rubocop_0.53.gemfile - - rvm: 2.7 - gemfile: gemfiles/rubocop_0.53.gemfile - - rvm: 3.0 - gemfile: gemfiles/rubocop_0.53.gemfile - include: - - rvm: jruby-9.2.9.0 - gemfile: gemfiles/rubocop_0.81.gemfile - script: *script_rubocop - - rvm: 2.3.0 - gemfile: gemfiles/rubocop_0.81.gemfile - script: *script_rubocop - - rvm: 2.4 - gemfile: gemfiles/rubocop_0.81.gemfile - script: *script_rubocop - - rvm: 2.5 - gemfile: gemfiles/rubocop_0.81.gemfile - script: *script_rubocop - - rvm: 2.6 - gemfile: gemfiles/rubocop_0.81.gemfile - script: *script_rubocop - - rvm: 2.7 - gemfile: gemfiles/rubocop_0.81.gemfile - script: *script_rubocop - - rvm: 3.0 - gemfile: gemfiles/rubocop_0.81.gemfile - script: *script_rubocop - -before_install: gem install --remote bundler -install: - - bundle install --retry=3 -script: - - bundle exec rspec diff --git a/Appraisals b/Appraisals index 16c30cb..60202ec 100644 --- a/Appraisals +++ b/Appraisals @@ -1,23 +1,9 @@ # frozen_string_literal: true -appraise 'rubocop-0.53' do - gem 'rubocop', '~> 0.53.0' +appraise 'rubocop-0.86' do + gem 'rubocop', '~> 0.86.0' end -appraise 'rubocop-0.81' do - gem 'rubocop', '~> 0.81.0' -end - -if Gem::Requirement.new('>= 2.4.0') - .satisfied_by?(Gem::Version.new(RUBY_VERSION)) - appraise 'rubocop-0.86' do - gem 'rubocop', '~> 0.86.0' - end -end - -if Gem::Requirement.new('>= 2.5.0') - .satisfied_by?(Gem::Version.new(RUBY_VERSION)) - appraise 'rubocop-1.20' do - gem 'rubocop', '~> 1.20.0' - end +appraise 'rubocop-1.20' do + gem 'rubocop', '~> 1.20.0' end diff --git a/gemfiles/rubocop_0.53.gemfile b/gemfiles/rubocop_0.53.gemfile deleted file mode 100644 index 55b8330..0000000 --- a/gemfiles/rubocop_0.53.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rubocop", "~> 0.53.0" - -gemspec path: "../" diff --git a/gemfiles/rubocop_0.81.gemfile b/gemfiles/rubocop_0.81.gemfile deleted file mode 100644 index 65788b6..0000000 --- a/gemfiles/rubocop_0.81.gemfile +++ /dev/null @@ -1,7 +0,0 @@ -# This file was generated by Appraisal - -source "https://rubygems.org" - -gem "rubocop", "~> 0.81.0" - -gemspec path: "../" diff --git a/rubocop-thread_safety.gemspec b/rubocop-thread_safety.gemspec index c1335b0..9e3205a 100644 --- a/rubocop-thread_safety.gemspec +++ b/rubocop-thread_safety.gemspec @@ -26,7 +26,7 @@ Gem::Specification.new do |spec| spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) } spec.require_paths = ['lib'] - spec.required_ruby_version = '>= 2.3.0' + spec.required_ruby_version = '>= 2.5.0' spec.add_runtime_dependency 'rubocop', '>= 0.53.0'