diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 505fec1f..0db93ce7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:53+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:49:46+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. name: RSpec CI @@ -16,12 +16,27 @@ env: # This tells rspec-rails what branch to run in ci RSPEC_VERSION: '= 3.11.0.pre' jobs: + rubocop: + name: Rubocop + runs-on: 'ubuntu-20.04' + steps: + - uses: actions/checkout@v2 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0' + - run: script/update_rubygems_and_install_bundler + - run: script/clone_all_rspec_repos + - run: bundle install --standalone + - run: bundle binstubs --all + - run: script/run_rubocop + test: name: Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }} runs-on: ${{ matrix.os || 'ubuntu-20.04' }} strategy: matrix: ruby: + - '3.1' - '3.0' - 2.7 - 2.6 diff --git a/.rubocop_rspec_base.yml b/.rubocop_rspec_base.yml index 0d61567c..fcc61688 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:53+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:49:46+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # This file contains defaults for RSpec projects. Individual projects diff --git a/script/ci_functions.sh b/script/ci_functions.sh index 391bcd82..500ba12a 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:53+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:49:46+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. # Taken from: diff --git a/script/clone_all_rspec_repos b/script/clone_all_rspec_repos index 1a18cecc..d4acccf4 100755 --- a/script/clone_all_rspec_repos +++ b/script/clone_all_rspec_repos @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-15T10:45:53+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:49:46+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/cucumber.sh b/script/cucumber.sh index e01a5686..c80d10b9 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-15T10:45:53+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:49:46+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/functions.sh b/script/functions.sh index bbd34410..73500ff5 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:53+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:49:46+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" diff --git a/script/legacy_setup.sh b/script/legacy_setup.sh index d747899d..50df0ed3 100755 --- a/script/legacy_setup.sh +++ b/script/legacy_setup.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-15T10:45:53+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:49:46+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e diff --git a/script/predicate_functions.sh b/script/predicate_functions.sh index b9dd3b8c..15ec0df6 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:53+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:49:46+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. function is_mri { @@ -95,9 +95,22 @@ function is_ruby_25_plus { fi } +function is_ruby_31_plus { + if ruby -e "exit(RUBY_VERSION.to_f >= 3.1)"; then + return 0 + else + return 1 + fi +} + function rspec_rails_compatible { if is_ruby_25_plus; then - return 0 + # TODO remove when RSpec-Rails build is 3.1 safe by default + if is_ruby_31_plus; then + return 1 + else + return 0 + fi else return 1 fi diff --git a/script/run_build b/script/run_build index dd722ddb..9991bb84 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-15T10:45:53+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:49:46+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e @@ -24,10 +24,6 @@ if documentation_enforced; then fold "doc check" check_documentation_coverage fi -if style_and_lint_enforced; then - fold "rubocop" check_style_and_lint -fi - if supports_cross_build_checks; then fold "one-by-one specs" run_specs_one_by_one export NO_COVERAGE=true diff --git a/script/run_rubocop b/script/run_rubocop new file mode 100755 index 00000000..52e9e8a3 --- /dev/null +++ b/script/run_rubocop @@ -0,0 +1,14 @@ +#!/bin/bash +# This file was generated on 2022-01-10T22:49:46+00:00 from the rspec-dev repo. +# DO NOT modify it by hand as your changes will get lost the next time it is generated. + +set -e +source script/functions.sh + +# Allow repos to override the default functions and add their own +if [ -f script/custom_build_functions.sh ]; then + source script/custom_build_functions.sh +fi + + +fold "rubocop" check_style_and_lint diff --git a/script/update_rubygems_and_install_bundler b/script/update_rubygems_and_install_bundler index 0c7d34a3..d8e44f82 100755 --- a/script/update_rubygems_and_install_bundler +++ b/script/update_rubygems_and_install_bundler @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-15T10:45:53+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:49:46+00:00 from the rspec-dev repo. # DO NOT modify it by hand as your changes will get lost the next time it is generated. set -e