diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c297292 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,22 @@ +name: Tests + +on: [push, pull_request] + +jobs: + test: + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + ruby-version: [3.2, 3.1, '3.0', 2.7] + + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # 'bundle install' and cache + - 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..5f473e4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,23 @@ +name: Lint + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + + strategy: + matrix: + ruby-version: [2.7] + + steps: + - uses: actions/checkout@v3 + - name: Set up Ruby ${{ matrix.ruby-version }} + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true # 'bundle install' and cache + - name: Sorbet + run: bundle exec srb tc + - name: Rubocop + run: bundle exec rubocop diff --git a/Gemfile.lock b/Gemfile.lock index d50112e..8fe1e98 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -2,6 +2,7 @@ PATH remote: . specs: quarantine (2.2.2) + activesupport (~> 6.1) rspec (~> 3.0) rspec-retry (~> 0.6) sorbet-runtime (~> 0.5.6338) @@ -9,64 +10,55 @@ PATH GEM remote: https://rubygems.org/ specs: - abstract_type (0.0.7) - activesupport (6.1.0) + activesupport (6.1.7.2) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 1.6, < 2) minitest (>= 5.1) tzinfo (~> 2.0) zeitwerk (~> 2.3) - adamantium (0.2.0) - ice_nine (~> 0.11.0) - memoizable (~> 0.4.0) - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - anima (0.3.2) - abstract_type (~> 0.0.7) - adamantium (~> 0.2) - equalizer (~> 0.0.11) - ast (2.4.1) - aws-eventstream (1.1.1) - aws-partitions (1.436.0) - aws-sdk-core (3.113.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) + ast (2.4.2) + aws-eventstream (1.2.0) + aws-partitions (1.701.0) + aws-sdk-core (3.170.0) aws-eventstream (~> 1, >= 1.0.2) - aws-partitions (~> 1, >= 1.239.0) + aws-partitions (~> 1, >= 1.651.0) + aws-sigv4 (~> 1.5) + jmespath (~> 1, >= 1.6.1) + aws-sdk-dynamodb (1.81.0) + aws-sdk-core (~> 3, >= 3.165.0) aws-sigv4 (~> 1.1) - jmespath (~> 1.0) - aws-sdk-dynamodb (1.60.0) - aws-sdk-core (~> 3, >= 3.112.0) - aws-sigv4 (~> 1.1) - aws-sigv4 (1.2.3) + aws-sigv4 (1.5.2) aws-eventstream (~> 1, >= 1.0.2) coderay (1.1.3) - colorize (0.8.1) - concord (0.1.6) - adamantium (~> 0.2.0) - equalizer (~> 0.0.9) - concurrent-ruby (1.1.7) + concurrent-ruby (1.2.0) declarative (0.0.20) - diff-lcs (1.4.4) - equalizer (0.0.11) - faraday (1.7.0) + diff-lcs (1.5.0) + faraday (1.10.3) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0.1) + faraday-httpclient (~> 1.0) + faraday-multipart (~> 1.0) faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.1) + faraday-net_http_persistent (~> 1.0) faraday-patron (~> 1.0) faraday-rack (~> 1.0) - multipart-post (>= 1.2, < 3) + faraday-retry (~> 1.0) ruby2_keywords (>= 0.0.4) faraday-em_http (1.0.0) faraday-em_synchrony (1.0.0) faraday-excon (1.1.0) faraday-httpclient (1.0.1) + faraday-multipart (1.0.4) + multipart-post (~> 2) faraday-net_http (1.0.1) faraday-net_http_persistent (1.2.0) faraday-patron (1.0.0) faraday-rack (1.0.0) - google-apis-core (0.4.1) + faraday-retry (1.0.3) + google-apis-core (0.10.0) addressable (~> 2.5, >= 2.5.1) googleauth (>= 0.16.2, < 2.a) httpclient (>= 2.8.1, < 3.a) @@ -75,149 +67,138 @@ GEM retriable (>= 2.0, < 4.a) rexml webrick - google-apis-drive_v3 (0.13.0) - google-apis-core (>= 0.4, < 2.a) - google-apis-sheets_v4 (0.9.0) - google-apis-core (>= 0.4, < 2.a) + google-apis-drive_v3 (0.33.0) + google-apis-core (>= 0.9.1, < 2.a) + google-apis-sheets_v4 (0.21.0) + google-apis-core (>= 0.9.1, < 2.a) google_drive (3.0.7) google-apis-drive_v3 (>= 0.5.0, < 1.0.0) google-apis-sheets_v4 (>= 0.4.0, < 1.0.0) googleauth (>= 0.5.0, < 1.0.0) nokogiri (>= 1.5.3, < 2.0.0) - googleauth (0.17.0) + googleauth (0.17.1) faraday (>= 0.17.3, < 2.0) jwt (>= 1.4, < 3.0) memoist (~> 0.16) multi_json (~> 1.11) os (>= 0.9, < 2.0) - signet (~> 0.14) + signet (~> 0.15) httpclient (2.8.3) - i18n (1.8.5) + i18n (1.12.0) concurrent-ruby (~> 1.0) - ice_nine (0.11.2) - jmespath (1.4.0) - jwt (2.2.3) + jmespath (1.6.2) + json (2.6.3) + jwt (2.6.0) memoist (0.16.2) - memoizable (0.4.2) - thread_safe (~> 0.3, >= 0.3.1) method_source (1.0.0) - mini_mime (1.1.0) - mini_portile2 (2.6.1) - minitest (5.14.2) - mprelude (0.1.0) - abstract_type (~> 0.0.7) - adamantium (~> 0.2.0) - concord (~> 0.1.5) - equalizer (~> 0.0.9) - ice_nine (~> 0.11.1) - procto (~> 0.0.2) + mini_mime (1.1.2) + minitest (5.17.0) multi_json (1.15.0) - multipart-post (2.1.1) - nokogiri (1.12.2) - mini_portile2 (~> 2.6.1) + multipart-post (2.3.0) + nokogiri (1.14.0-x86_64-darwin) + racc (~> 1.4) + nokogiri (1.14.0-x86_64-linux) racc (~> 1.4) - os (1.1.1) - parallel (1.20.1) - parser (2.7.2.0) + os (1.1.4) + parallel (1.22.1) + parser (3.2.0.0) ast (~> 2.4.1) - procto (0.0.3) - pry (0.14.1) + pry (0.14.2) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (4.0.6) - racc (1.5.2) - rack (2.2.3) - rainbow (3.0.0) - rbi (0.0.5) + public_suffix (5.0.1) + racc (1.6.2) + rack (3.0.4.1) + rainbow (3.1.1) + rbi (0.0.16) ast - parser - sorbet-runtime + parser (>= 2.6.4.0) + sorbet-runtime (>= 0.5.9204) unparser - regexp_parser (2.0.0) - representable (3.1.1) + regexp_parser (2.6.2) + representable (3.2.0) declarative (< 0.1.0) trailblazer-option (>= 0.1.1, < 0.2.0) uber (< 0.2.0) retriable (3.1.2) - rexml (3.2.4) - rspec (3.10.0) - rspec-core (~> 3.10.0) - rspec-expectations (~> 3.10.0) - rspec-mocks (~> 3.10.0) - rspec-core (3.10.1) - rspec-support (~> 3.10.0) - rspec-expectations (3.10.1) + rexml (3.2.5) + rspec (3.12.0) + rspec-core (~> 3.12.0) + rspec-expectations (~> 3.12.0) + rspec-mocks (~> 3.12.0) + rspec-core (3.12.0) + rspec-support (~> 3.12.0) + rspec-expectations (3.12.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) - rspec-mocks (3.10.2) + rspec-support (~> 3.12.0) + rspec-mocks (3.12.3) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.10.0) + rspec-support (~> 3.12.0) rspec-retry (0.6.2) rspec-core (> 3.3) - rspec-support (3.10.2) - rubocop (1.6.1) + rspec-support (3.12.0) + rubocop (1.44.1) + json (~> 2.3) parallel (~> 1.10) - parser (>= 2.7.1.5) + parser (>= 3.2.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) - rexml - rubocop-ast (>= 1.2.0, < 2.0) + rexml (>= 3.2.5, < 4.0) + rubocop-ast (>= 1.24.1, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) - rubocop-ast (1.3.0) - parser (>= 2.7.1.5) - rubocop-rails (2.9.1) + unicode-display_width (>= 2.4.0, < 3.0) + rubocop-ast (1.24.1) + parser (>= 3.1.1.0) + rubocop-rails (2.17.4) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 0.90.0, < 2.0) - rubocop-sorbet (0.3.7) - ruby-progressbar (1.10.1) + rubocop (>= 1.33.0, < 2.0) + rubocop-sorbet (0.6.11) + rubocop (>= 0.90.0) + ruby-progressbar (1.11.0) ruby2_keywords (0.0.5) - signet (0.15.0) - addressable (~> 2.3) - faraday (>= 0.17.3, < 2.0) + signet (0.17.0) + addressable (~> 2.8) + faraday (>= 0.17.5, < 3.a) jwt (>= 1.5, < 3.0) multi_json (~> 1.10) - sorbet (0.5.9297) - sorbet-static (= 0.5.9297) - sorbet-runtime (0.5.6338) - sorbet-static (0.5.9297-universal-darwin-14) - spoom (1.1.3) - colorize - sorbet (>= 0.5.6347) - sorbet-runtime + sorbet (0.5.10634) + sorbet-static (= 0.5.10634) + sorbet-runtime (0.5.10634) + sorbet-static (0.5.10634-universal-darwin-22) + sorbet-static (0.5.10634-x86_64-linux) + spoom (1.1.15) + sorbet (>= 0.5.10187) + sorbet-runtime (>= 0.5.9204) thor (>= 0.19.2) - tapioca (0.5.2) + tapioca (0.5.6) bundler (>= 1.17.3) pry (>= 0.12.2) - rbi - sorbet-runtime - sorbet-static (>= 0.4.4471) - spoom + rbi (~> 0.0.0, >= 0.0.8) + sorbet-runtime (>= 0.5.9204) + sorbet-static (>= 0.5.9204) + spoom (~> 1.1.0, >= 1.1.4) thor (>= 0.19.2) - unparser - thor (1.1.0) - thread_safe (0.3.6) - trailblazer-option (0.1.1) - tzinfo (2.0.4) + yard-sorbet + thor (1.2.1) + trailblazer-option (0.1.2) + tzinfo (2.0.6) concurrent-ruby (~> 1.0) uber (0.1.0) - unicode-display_width (1.7.0) - unparser (0.5.5) - abstract_type (~> 0.0.7) - adamantium (~> 0.2.0) - anima (~> 0.3.1) - concord (~> 0.1.5) + unicode-display_width (2.4.2) + unparser (0.6.7) diff-lcs (~> 1.3) - equalizer (~> 0.0.9) - mprelude (~> 0.1.0) - parser (>= 2.6.5) - procto (~> 0.0.2) - webrick (1.7.0) - zeitwerk (2.4.2) + parser (>= 3.2.0) + webrick (1.8.1) + yard (0.9.26) + yard-sorbet (0.8.0) + sorbet-runtime (>= 0.5) + yard (>= 0.9) + zeitwerk (2.6.6) PLATFORMS - ruby + x86_64-darwin-22 + x86_64-linux DEPENDENCIES aws-sdk-dynamodb (~> 1) @@ -230,4 +211,4 @@ DEPENDENCIES tapioca (~> 0.5.2) BUNDLED WITH - 2.1.4 + 2.4.5 diff --git a/quarantine.gemspec b/quarantine.gemspec index 9bfa5bc..25180ba 100644 --- a/quarantine.gemspec +++ b/quarantine.gemspec @@ -18,6 +18,7 @@ Gem::Specification.new do |s| s.executables = ['quarantine_dynamodb'] s.required_ruby_version = '>= 2.0' + s.add_dependency('activesupport', '~> 6.1') s.add_dependency('rspec', '~> 3.0') s.add_dependency('rspec-retry', '~> 0.6') s.add_dependency('sorbet-runtime', '~> 0.5.6338') diff --git a/spec/quarantine/cli_spec.rb b/spec/quarantine/cli_spec.rb index 8fbaf95..a312991 100644 --- a/spec/quarantine/cli_spec.rb +++ b/spec/quarantine/cli_spec.rb @@ -1,4 +1,5 @@ # typed: false + require 'spec_helper' require_relative '../../lib/quarantine/cli' diff --git a/spec/quarantine/databases/dynamo_db_spec.rb b/spec/quarantine/databases/dynamo_db_spec.rb index 561c04f..fe6dc77 100644 --- a/spec/quarantine/databases/dynamo_db_spec.rb +++ b/spec/quarantine/databases/dynamo_db_spec.rb @@ -1,4 +1,5 @@ # typed: false + require 'spec_helper' describe Quarantine::Databases::DynamoDB do @@ -128,19 +129,19 @@ a6: 'a6' } - expect(database.dynamodb).to receive(:create_table).with( - table_name: 'foo', - attribute_definitions: [ - { attribute_name: 'a1', attribute_type: 'S' }, - { attribute_name: 'a2', attribute_type: 'S' } - ], - key_schema: [ - { attribute_name: 'a1', key_type: 'HASH' }, - { attribute_name: 'a2', key_type: 'RANGE' } - ], - a3: { a4: 'a4', a5: 'a5' }, - a6: 'a6' - ) + expect(database.dynamodb).to receive(:create_table).with({ + table_name: 'foo', + attribute_definitions: [ + { attribute_name: 'a1', attribute_type: 'S' }, + { attribute_name: 'a2', attribute_type: 'S' } + ], + key_schema: [ + { attribute_name: 'a1', key_type: 'HASH' }, + { attribute_name: 'a2', key_type: 'RANGE' } + ], + a3: { a4: 'a4', a5: 'a5' }, + a6: 'a6' + }) database.create_table('foo', attributes, additional_arguments) end diff --git a/spec/quarantine/test_spec.rb b/spec/quarantine/test_spec.rb index 19baf55..498ba4b 100644 --- a/spec/quarantine/test_spec.rb +++ b/spec/quarantine/test_spec.rb @@ -1,4 +1,5 @@ # typed: false + require 'spec_helper' describe Quarantine::Test do diff --git a/spec/quarantine_spec.rb b/spec/quarantine_spec.rb index 4dbfcb2..433399a 100644 --- a/spec/quarantine_spec.rb +++ b/spec/quarantine_spec.rb @@ -1,4 +1,5 @@ # typed: false + require 'spec_helper' describe Quarantine do diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 064d111..6f120a3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,4 +1,5 @@ # typed: strict + require 'quarantine' require 'rspec/retry'