Skip to content

Commit

Permalink
Merge pull request #78 from jnbt/github-actions
Browse files Browse the repository at this point in the history
Add GH actions
  • Loading branch information
jnbt committed Feb 23, 2023
2 parents 39f3ea2 + a7a16c8 commit 003789b
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 31 deletions.
31 changes: 31 additions & 0 deletions .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
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

4 changes: 2 additions & 2 deletions 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)
Expand Down
5 changes: 3 additions & 2 deletions candy_check.gemspec
Expand Up @@ -18,15 +18,14 @@ 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"
spec.add_dependency "multi_json", "~> 1.10"
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"
Expand All @@ -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
4 changes: 2 additions & 2 deletions lib/candy_check/cli/app.rb
Expand Up @@ -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"
Expand All @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions spec/cli/app_spec.rb
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/play_store/product_purchases/product_purchase_spec.rb
Expand Up @@ -99,7 +99,7 @@ class FakeProductPurchase
:purchase_time_millis,
].freeze

attr_accessor *FIELDS
attr_accessor(*FIELDS)

def initialize(hash)
FIELDS.each do |key|
Expand Down
Expand Up @@ -226,7 +226,7 @@ class FakeSubscriptionPurchase
:price_currency_code,
].freeze

attr_accessor *FIELDS
attr_accessor(*FIELDS)

def initialize(hash)
FIELDS.each do |key|
Expand Down
17 changes: 15 additions & 2 deletions spec/spec_helper.rb
@@ -1,5 +1,3 @@
require "coveralls"
Coveralls.wear!

require "candy_check"
require "candy_check/cli"
Expand All @@ -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?
Expand Down

0 comments on commit 003789b

Please sign in to comment.