Skip to content

Commit 1b66607

Browse files
authored
Add ruby 2.7 support (#81)
* Fix ruby 2.7 deprecation warnings * Fail fast: false * Update bundler * Fix job name * Revert formatter change * Fix deprecation warning * Cache gems * Add step names * Reduce bundler output * Force colors * Minor step name tweak
1 parent 793376a commit 1b66607

File tree

9 files changed

+81
-49
lines changed

9 files changed

+81
-49
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,28 @@ jobs:
88
release:
99
runs-on: ubuntu-16.04
1010
steps:
11-
- uses: actions/checkout@master
11+
- name: Checkout
12+
uses: actions/checkout@master
1213

13-
- name: Set up Ruby 2.6
14+
- name: Cache gems
15+
uses: actions/cache@v1
16+
with:
17+
path: vendor/bundle
18+
key: 2.7-gems-${{ hashFiles('Gemfile.lock') }}
19+
restore-keys: 2.7-gems-
20+
21+
- name: Set up Ruby
1422
uses: actions/setup-ruby@v1
1523
with:
16-
ruby-version: 2.6.x
24+
ruby-version: '2.7'
1725

1826
- name: Install
1927
run: |
20-
gem install bundler -v 2.0.2 --no-document
28+
gem install bundler -v 2.1.2 --no-document
29+
bundle config path vendor/bundle
2130
bundle install -j $(nproc)
31+
env:
32+
BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES: 'true'
2233

2334
- name: Test
2435
run: bundle exec rake

.github/workflows/test.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
11+
jobs:
12+
test:
13+
name: Test
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
ruby: ['2.5', '2.6', '2.7']
19+
fail-fast: false
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@master
24+
25+
- name: Cache gems
26+
uses: actions/cache@v1
27+
with:
28+
path: vendor/bundle
29+
key: ${{ matrix.ruby }}-gems-${{ hashFiles('Gemfile.lock') }}
30+
restore-keys: ${{ matrix.ruby }}-gems-
31+
32+
- name: Set up Ruby ${{ matrix.ruby }}
33+
uses: actions/setup-ruby@v1
34+
with:
35+
ruby-version: ${{ matrix.ruby }}
36+
37+
- name: Install
38+
run: |
39+
gem install bundler -v 2.1.2 --no-document
40+
bundle config path vendor/bundle
41+
bundle install -j $(nproc)
42+
env:
43+
BUNDLE_SUPPRESS_INSTALL_USING_MESSAGES: 'true'
44+
45+
- name: Lint
46+
run: bundle exec rake rubocop
47+
48+
- name: Test
49+
run: bundle exec rake test_with_coverage
50+
env:
51+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
52+
CI: "true"
53+
CI_NAME: github-ci
54+
CI_PULL_REQUEST: ${{ github.event.number }}
55+
CONTEXT: ${{ toJson(github) }}

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
2.7.0

Gemfile.lock

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PATH
77
allure-rspec (2.13.3)
88
allure-ruby-commons (= 2.13.3)
99
rspec-core (~> 3.8)
10+
ruby2_keywords (~> 0.0.2)
1011
allure-ruby (2.13.3)
1112
allure-cucumber (= 2.13.3)
1213
allure-rspec (= 2.13.3)
@@ -54,7 +55,7 @@ GEM
5455
e2mmap (0.1.0)
5556
gherkin (5.1.0)
5657
jaro_winkler (1.5.4)
57-
json (2.2.0)
58+
json (2.3.0)
5859
lefthook (0.7.1)
5960
macaddr (1.7.2)
6061
systemu (~> 2.6.5)
@@ -104,6 +105,7 @@ GEM
104105
rubocop-performance (1.5.2)
105106
rubocop (>= 0.71.0)
106107
ruby-progressbar (1.10.1)
108+
ruby2_keywords (0.0.2)
107109
semantic (1.6.1)
108110
simplecov (0.16.1)
109111
docile (~> 1.1)
@@ -154,4 +156,4 @@ DEPENDENCIES
154156
solargraph (~> 0.35)
155157

156158
BUNDLED WITH
157-
2.0.2
159+
2.1.2

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Allure ruby
22

33
[![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](https://rubydoc.info/github/allure-framework/allure-ruby/master)
4-
![Workflow status](https://github.com/allure-framework/allure-ruby/workflows/Build/badge.svg)
4+
![Workflow status](https://github.com/allure-framework/allure-ruby/workflows/Test/badge.svg)
55
[![Coverage Status](https://coveralls.io/repos/github/allure-framework/allure-ruby/badge.svg?branch=master)](https://coveralls.io/github/allure-framework/allure-ruby?branch=master)
66
Ruby testing framework adaptors for generating allure compatible test reports.
77

allure-rspec/allure-rspec.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,5 @@ Gem::Specification.new do |s|
2929

3030
s.add_dependency "allure-ruby-commons", version
3131
s.add_dependency "rspec-core", "~> 3.8"
32+
s.add_dependency "ruby2_keywords", "~> 0.0.2"
3233
end

allure-rspec/lib/allure_rspec/formatter.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# frozen_string_literal: true
22

3+
require "ruby2_keywords"
34
require "rspec/core"
45
require "rspec/core/formatters/base_formatter"
56

@@ -20,7 +21,7 @@ class RSpecFormatter < RSpec::Core::Formatters::BaseFormatter
2021

2122
RSpec::Core::Example.class_eval do
2223
Allure.singleton_methods.each do |method|
23-
define_method(method) { |*args, &block| Allure.__send__(method, *args, &block) }
24+
ruby2_keywords define_method(method) { |*args, &block| Allure.__send__(method, *args, &block) }
2425
end
2526
end
2627

rake/test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ def initialize
1818
def self.add_rspec_task
1919
RSpec::Core::RakeTask.new(:test, :tag) do |task, args|
2020
args[:tag].tap do |tag|
21-
task.rspec_opts = "--color --require spec_helper --format documentation #{tag ? "--tag #{tag}" : ''}"
21+
task.rspec_opts = "--color --tty --require spec_helper --format documentation #{tag ? "--tag #{tag}" : ''}"
2222
task.verbose = false
2323
end
2424
end
2525
end
2626

2727
def self.add_rubocop_task
2828
RuboCop::RakeTask.new(:rubocop) do |task|
29-
task.options = %w[--parallel]
29+
task.options = %w[--parallel --color]
3030
task.verbose = false
3131
end
3232
end

0 commit comments

Comments
 (0)