8000 Fix/workflow ci permutations (#570) · cucumber/cucumber-rails@fb2c6e9 · GitHub
[go: up one dir, main page]

Skip to content

Commit fb2c6e9

Browse files
authored
Fix/workflow ci permutations (#570)
* Try use differing versions of compatible gems to get selenium scenarios running * Remove running config from matrix * Re-order some rubocop stuff * Fix rubocop * Tweak workflow to avoid double running
1 parent 81b974f commit fb2c6e9

File tree

3 files changed

+36
-27
lines changed

3 files changed

+36
-27
lines changed

.github/workflows/test.yml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
11
---
22
name: build
3-
on: [ push, pull_request, workflow_call ]
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- renovate/**
8+
pull_request:
9+
branches:
10+
- main
11+
workflow_call:
12+
413
jobs:
514
test:
615
runs-on: ubuntu-latest
@@ -26,8 +35,11 @@ jobs:
2635
- { ruby: '2.6', gemfile: 'rails_6_1' }
2736
- { ruby: '2.6', gemfile: 'rails_7_0' }
2837
- { ruby: '2.7', gemfile: 'rails_7_0' }
29-
- { ruby: '3.0', gemfile: 'rails_5_2' } # Rails 5.2 won't work with Ruby 3+: https://github.com/rails/rails/issues/40938
38+
# Ruby 3+ won't work with Rails 5.2: https://github.com/rails/rails/issues/40938
39+
- { ruby: '3.0', gemfile: 'rails_5_2' }
3040
- { ruby: '3.1', gemfile: 'rails_5_2' }
41+
# Ruby 3.1+ has a conflicting Psych version with Rails 6.0 (And maybe 6.1...): https://stackoverflow.com/questions/71191685/visit-psych-nodes-alias-unknown-alias-default-psychbadalias
42+
- { ruby: '3.1', gemfile: 'rails_6_0' }
3143
- { ruby: '3.2', gemfile: 'rails_5_2' }
3244
- { ruby: '3.2', gemfile: 'rails_6_0' }
3345
env:

.rubocop.yml

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,16 @@ AllCops:
1313
- 'gemfiles/*.gemfile'
1414
- 'vendor/**/*'
1515

16-
# These two areas will frequently break this limit, so we ignore the limit
17-
Metrics/BlockLength:
18-
Exclude:
19-
- './spec/**/*_spec.rb'
20-
- 'cucumber-rails.gemspec'
16+
# Disabled on our repo's to enable polyglot-release
17+
Gemspec/RequireMFA:
18+
Enabled: false
2119

22-
# This allows us to read the chmod action in a more reproducible way
23-
Style/NumericLiteralPrefix:
24-
EnforcedOctalStyle: zero_only
20+
Layout/LineLength:
21+
Max: 200
22+
AllowedPatterns:
23+
- '^Given'
24+
- '^When'
25+
- '^Then'
2526

2627
# This needs fixing as it's inheriting a lot more than what we originally need.
2728
# The inheritance chain goes all the way down to a single test case which the world
@@ -30,14 +31,15 @@ Lint/MissingSuper:
3031
Exclude:
3132
- lib/cucumber/rails/world.rb
3233

33-
## Cucumber Repo styles (Across implementations) ##
34+
# These can both be removed once we upgrade rubocop and rubocop-rspec to more up to date versions
35+
Metrics/BlockLength:
36+
Exclude:
37+
- './spec/**/*_spec.rb'
38+
- 'cucumber-rails.gemspec'
3439

35-
Layout/LineLength:
36-
Max: 200
37-
AllowedPatterns:
38-
- '^Given'
39-
- '^When'
40-
- '^Then'
40+
# This allows us to read the chmod action in a more reproducible way
41+
Style/NumericLiteralPrefix:
42+
EnforcedOctalStyle: zero_only
4143

4244
Style/Documentation:
4345
Enabled: false
@@ -48,7 +50,3 @@ Style/RegexpLiteral:
4850

4951
RSpec/MessageSpies:
5052
EnforcedStyle: receive
51-
52-
# TODO: investigate changes to release process and then enable MFA (https://guides.rubygems.org/mfa-requirement-opt-in/)
53-
Gemspec/RequireMFA:
54-
Enabled: false

features/support/cucumber_rails_helper.rb

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def rails_new(options = {})
99
# This expectation allows us to wait until the command line monitor has output a README file (i.e. the command has completed)
1010
expect(run_rails_new_command(options)).to have_output(/README/)
1111

12-
cd options[:name]
12+
cd 'test_app'
1313
configure_rails_gems
1414
configure_rails_requires
1515
configure_rails_layout
@@ -27,11 +27,10 @@ def install_cucumber_rails(*options)
2727
private
2828

2929
def run_rails_new_command(options)
30-
options[:name] ||= 'test_app'
3130
flags = %w[--skip-action-cable --skip-action-mailer --skip-active-job --skip-bootsnap --skip-bundle --skip-javascript
3231
--skip-jbuilder --skip-listen --skip-spring --skip-sprockets --skip-test-unit --skip-turbolinks --skip-active-storage]
3332
flags += %w[--skip-action-mailbox --skip-action-text] if rails_equal_or_higher_than?('6.0')
34-
run_command "bundle exec rails new #{options[:name]} #{flags.join(' ')} #{options[:args]}"
33+
run_command "bundle exec rails new test_app #{flags.join(' ')} #{options[:args]}"
3534
end
3635

3736
def configure_rails_gems
@@ -101,13 +100,13 @@ def add_rails_conditional_gems
101100
if rails_equal_or_higher_than?('6.0')
102101
add_gem 'sqlite3', '~> 1.4'
103102
add_gem 'selenium-webdriver', '~> 4.0', group: :test
103+
add_gem 'webdrivers', '~> 5.0', group: :test
104104
else
105105
add_gem 'sqlite3', '~> 1.3.13'
106106
add_gem 'selenium-webdriver', '< 4', group: :test
107+
add_gem 'webdrivers', '~> 4.0', group: :test
108+
remove_gem 'chromedriver-helper'
107109
end
108-
109-
add_gem 'webdrivers', '~> 5.0' unless rails_equal_or_higher_than?('7.0')
110-
remove_gem 'chromedriver-helper' unless rails_equal_or_higher_than?('6.0')
111110
end
112111

113112
def add_remaining_gems(options)

0 commit comments

Comments
 (0)
0