Skip to content

Commit 27dbee1

Browse files
authored
Merge pull request #294 from rspec/ruby-31-main
Ruby 3.1
2 parents 0a8bec7 + a4d10df commit 27dbee1

File tree

4 files changed

+40
-5
lines changed

4 files changed

+40
-5
lines changed

ci/.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,27 @@ env:
1313
# This tells rspec-rails what branch to run in ci
1414
RSPEC_VERSION: '= 3.11.0.pre'
1515
jobs:
16+
rubocop:
17+
name: Rubocop
18+
runs-on: 'ubuntu-20.04'
19+
steps:
20+
- uses: actions/checkout@v2
21+
- uses: ruby/setup-ruby@v1
22+
with:
23+
ruby-version: '3.0'
24+
- run: script/update_rubygems_and_install_bundler
25+
- run: script/clone_all_rspec_repos
26+
- run: bundle install --standalone
27+
- run: bundle binstubs --all
28+
- run: script/run_rubocop
29+
1630
test:
1731
name: Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }}
1832
runs-on: ${{ matrix.os || 'ubuntu-20.04' }}
1933
strategy:
2034
matrix:
2135
ruby:
36+
- '3.1'
2237
- '3.0'
2338
- 2.7
2439
- 2.6

ci/script/predicate_functions.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,22 @@ function is_ruby_25_plus {
9292
fi
9393
}
9494

95+
function is_ruby_31_plus {
96+
if ruby -e "exit(RUBY_VERSION.to_f >= 3.1)"; then
97+
return 0
98+
else
99+
return 1
100+
fi
101+
}
102+
95103
function rspec_rails_compatible {
96104
if is_ruby_25_plus; then
97-
return 0
105+
# TODO remove when RSpec-Rails build is 3.1 safe by default
106+
if is_ruby_31_plus; then
107+
return 1
108+
else
109+
return 0
110+
fi
98111
else
99112
return 1
100113
fi

ci/script/run_build

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ if documentation_enforced; then
2121
fold "doc check" check_documentation_coverage
2222
fi
2323

24-
if style_and_lint_enforced; then
25-
fold "rubocop" check_style_and_lint
26-
fi
27-
2824
if supports_cross_build_checks; then
2925
fold "one-by-one specs" run_specs_one_by_one
3026
export NO_COVERAGE=true

ci/script/run_rubocop

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -e
3+
source script/functions.sh
4+
5+
# Allow repos to override the default functions and add their own
6+
if [ -f script/custom_build_functions.sh ]; then
7+
source script/custom_build_functions.sh
8+
fi
9+
10+
11+
fold "rubocop" check_style_and_lint

0 commit comments

Comments
 (0)