diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..828afc5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: build +on: [push, pull_request] +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + ruby-version: + - "2.6" + - "2.7" + - "jruby-9.3.10.0" + steps: + - uses: actions/checkout@v3 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - run: bundle exec rake + - uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + flag-name: run-${{ matrix.ruby-version }} + parallel: true + finish: + needs: build + runs-on: ubuntu-latest + steps: + - uses: coverallsapp/github-action@master + with: + github-token: ${{ secrets.github_token }} + parallel-finished: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a53aaad..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: ruby -os: linux -dist: xenial -cache: bundler -rvm: - - 2.7.3 - - 2.6.7 - - 2.5.9 - - jruby-9.2.9.0 - - ruby-head - - jruby-head -jobs: - allow_failures: - - rvm: ruby-head - - rvm: jruby-head - fast_finish: true -before_install: - - gem update --system - - gem install bundler -v 2.0.2 diff --git a/README.md b/README.md index 464c43f..ccd25e3 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # candy_check [![Gem Version](https://badge.fury.io/rb/candy_check.svg)](http://badge.fury.io/rb/candy_check) -[![Build Status](https://travis-ci.org/jnbt/candy_check.svg?branch=master)](https://travis-ci.org/jnbt/candy_check) -[![Coverage Status](https://coveralls.io/repos/jnbt/candy_check/badge.svg?branch=master)](https://coveralls.io/r/jnbt/candy_check?branch=master) +[![Build Status](https://github.com/jnbt/candy_check/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/jnbt/candy_check/actions?query=branch%3Amaster) +[![Coverage Status](https://coveralls.io/repos/github/jnbt/candy_check/badge.svg?branch=master)](https://coveralls.io/github/jnbt/candy_check?branch=master) [![Code Climate](https://codeclimate.com/github/jnbt/candy_check/badges/gpa.svg)](https://codeclimate.com/github/jnbt/candy_check) [![Inline docs](http://inch-ci.org/github/jnbt/candy_check.svg?branch=master)](http://inch-ci.org/github/jnbt/candy_check) [![Yard Docs](http://img.shields.io/badge/yard-docs-blue.svg?style=flat)](http://www.rubydoc.info/github/jnbt/candy_check/master) diff --git a/candy_check.gemspec b/candy_check.gemspec index c4ef353..7942741 100644 --- a/candy_check.gemspec +++ b/candy_check.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = ["lib"] - spec.required_ruby_version = Gem::Requirement.new(">= 2.5") + spec.required_ruby_version = Gem::Requirement.new(">= 2.6") spec.add_dependency "google-apis-androidpublisher_v3", "~> 0.2.0" spec.add_dependency "googleauth", "~> 0.16" @@ -26,7 +26,6 @@ Gem::Specification.new do |spec| spec.add_dependency "thor", "< 2.0" spec.add_development_dependency "bundler", "~> 2.0" - spec.add_development_dependency "coveralls", "~> 0.8" spec.add_development_dependency "inch", "~> 0.7" spec.add_development_dependency "minitest", "~> 5.10" spec.add_development_dependency "minitest-around", "~> 0.4" @@ -40,4 +39,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency "awesome_print" spec.add_development_dependency "guard" spec.add_development_dependency "guard-minitest" + spec.add_development_dependency "simplecov", "~> 0.18.0" + spec.add_development_dependency "simplecov-lcov", "~> 0.8.0" end diff --git a/lib/candy_check/cli/app.rb b/lib/candy_check/cli/app.rb index 157c3de..6a19f94 100644 --- a/lib/candy_check/cli/app.rb +++ b/lib/candy_check/cli/app.rb @@ -21,7 +21,7 @@ class App < Thor desc: "The shared secret for auto-renewable subscriptions" def app_store(receipt) - Commands::AppStore.run(receipt, options) + Commands::AppStore.run(receipt, **options) end desc "play_store PACKAGE PRODUCT_ID TOKEN", "Verify PlayStore purchase" @@ -32,7 +32,7 @@ def app_store(receipt) desc: "The json key file to use for API authentication" def play_store(package, product_id, token) - Commands::PlayStore.run(package, product_id, token, options) + Commands::PlayStore.run(package, product_id, token, **options) end desc "version", 'Print the gem\'s version' diff --git a/spec/cli/app_spec.rb b/spec/cli/app_spec.rb index 19f2c3d..513d9b8 100644 --- a/spec/cli/app_spec.rb +++ b/spec/cli/app_spec.rb @@ -13,14 +13,14 @@ it 'supports the app_store command' do stub_command(CandyCheck::CLI::Commands::AppStore) do _(subject.app_store('receipt')).must_equal :stubbed - _(@arguments).must_equal ['receipt', {}] + _(@arguments).must_equal ['receipt'] end end it 'supports the play_store command' do stub_command(CandyCheck::CLI::Commands::PlayStore) do _(subject.play_store('package', 'id', 'token')).must_equal :stubbed - _(@arguments).must_equal ['package', 'id', 'token', {}] + _(@arguments).must_equal ['package', 'id', 'token'] end end diff --git a/spec/play_store/product_purchases/product_purchase_spec.rb b/spec/play_store/product_purchases/product_purchase_spec.rb index a5fe7b5..2416dc1 100644 --- a/spec/play_store/product_purchases/product_purchase_spec.rb +++ b/spec/play_store/product_purchases/product_purchase_spec.rb @@ -99,7 +99,7 @@ class FakeProductPurchase :purchase_time_millis, ].freeze - attr_accessor *FIELDS + attr_accessor(*FIELDS) def initialize(hash) FIELDS.each do |key| diff --git a/spec/play_store/subscription_purchases/subscription_purchase_spec.rb b/spec/play_store/subscription_purchases/subscription_purchase_spec.rb index 5d597c5..3880a49 100644 --- a/spec/play_store/subscription_purchases/subscription_purchase_spec.rb +++ b/spec/play_store/subscription_purchases/subscription_purchase_spec.rb @@ -226,7 +226,7 @@ class FakeSubscriptionPurchase :price_currency_code, ].freeze - attr_accessor *FIELDS + attr_accessor(*FIELDS) def initialize(hash) FIELDS.each do |key| diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b909a16..70b6004 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,3 @@ -require "coveralls" -Coveralls.wear! require "candy_check" require "candy_check/cli" @@ -8,6 +6,21 @@ def in_continuous_integration_environment? ENV["CI"] || ENV["TRAVIS"] || ENV["CONTINUOUS_INTEGRATION"] end +require "simplecov" + +SimpleCov.start do + if in_continuous_integration_environment? + require "simplecov-lcov" + + SimpleCov::Formatter::LcovFormatter.config do |c| + c.report_with_single_file = true + c.single_report_path = "coverage/lcov.info" + end + + formatter SimpleCov::Formatter::LcovFormatter + end +end + require "minitest/autorun" require "minitest/around/spec" require "minitest/focus" unless in_continuous_integration_environment?