Skip to content

Commit

Permalink
Merge 68cf548 into e27de34
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuEXE committed Nov 19, 2020
2 parents e27de34 + 68cf548 commit 453bad6
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .coveralls.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
service_name: travis-ci
service_name: github-ci
55 changes: 55 additions & 0 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Tests

on:
pull_request:
branches:
- master
paths-ignore:
- 'README.md'
push:
branches:
- master
paths-ignore:
- 'README.md'

jobs:
unit_tests:
name: Unit Tests
if: "contains(github.event.commits[0].message, '[ci skip]') == false"
strategy:
fail-fast: false
matrix:
os:
- ubuntu
ruby:
- 2.2
- 2.3
- 2.4
- 2.5
- 2.6
- 2.7
allow_failures:
- false
include:
- os: ubuntu
ruby: ruby-head
allow_failures: true
env:
ALLOW_FAILURES: "${{ matrix.allow_failures }}"
COVERAGE: true
runs-on: ${{ matrix.os }}-latest
continue-on-error: ${{ endsWith(matrix.ruby, 'head') || matrix.ruby == 'debug' }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Test
run: bundle exec rspec || $ALLOW_FAILURES
- name: Send to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ end
group :test do
gem 'rspec'
gem 'simplecov'
gem 'coveralls'
gem 'simplecov-lcov'
gem 'webmock'
end
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
require 'support/matchers'
require 'support/now'
require 'support/run'
require 'support/tty'

require 'webmock'
require 'webmock/rspec'
Expand All @@ -23,4 +24,5 @@
c.include Support::Files
c.include Support::Now
c.include Support::Run
c.include Support::Tty
end
16 changes: 12 additions & 4 deletions spec/support/coverage.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
if ENV['COVERAGE']
require 'simplecov'
require 'coveralls'
require "simplecov"
require "simplecov-lcov"

SimpleCov::Formatter::LcovFormatter.config do |c|
c.report_with_single_file = true
c.single_report_path = "coverage/lcov.info"
end

SimpleCov.formatters = SimpleCov::Formatter::MultiFormatter.new(
[SimpleCov::Formatter::HTMLFormatter, SimpleCov::Formatter::LcovFormatter]
)

SimpleCov.formatter = Coveralls::SimpleCov::Formatter
SimpleCov.start do
add_filter 'app/secrets'
add_filter "spec/"
end
end

7 changes: 7 additions & 0 deletions spec/support/tty.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Support
module Tty
def self.included(base)
base.before { allow($stdout).to receive(:tty?).and_return true }
end
end
end

0 comments on commit 453bad6

Please sign in to comment.