From 26727c3ed1710e2022d290b3617e8dd0e9aa37a7 Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Mon, 10 Jan 2022 22:24:10 +0000 Subject: [PATCH] Updated ci build scripts (from rspec-dev)main --- .github/workflows/ci.yml | 17 ++++++++++++++++- .rubocop_rspec_base.yml | 2 +- script/ci_functions.sh | 2 +- script/clone_all_rspec_repos | 2 +- script/cucumber.sh | 2 +- script/functions.sh | 2 +- script/legacy_setup.sh | 2 +- script/predicate_functions.sh | 17 +++++++++++++++-- script/run_build | 6 +----- script/run_rubocop | 14 ++++++++++++++ script/update_rubygems_and_install_bundler | 2 +- 11 files changed, 53 insertions(+), 15 deletions(-) create mode 100755 script/run_rubocop diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea52ddaafa..1d5de7f329 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+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 0adf2f7ca7..19ae673ce2 100644 --- a/.rubocop_rspec_base.yml +++ b/.rubocop_rspec_base.yml @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+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 44f68ac596..28d41f4a06 100644 --- a/script/ci_functions.sh +++ b/script/ci_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+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 cebc3f7a80..dc9822ae74 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:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+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 6982d35774..51ce7911e6 100755 --- a/script/cucumber.sh +++ b/script/cucumber.sh @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+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 72b4296e04..b42caa3828 100644 --- a/script/functions.sh +++ b/script/functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+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 9e72d4f5d8..9334052169 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:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+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 415d189127..d6f21a7b57 100644 --- a/script/predicate_functions.sh +++ b/script/predicate_functions.sh @@ -1,4 +1,4 @@ -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+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 794e12ca26..46c230ca70 100755 --- a/script/run_build +++ b/script/run_build @@ -1,5 +1,5 @@ #!/bin/bash -# This file was generated on 2021-07-15T10:45:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+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 0000000000..c2d94dcca3 --- /dev/null +++ b/script/run_rubocop @@ -0,0 +1,14 @@ +#!/bin/bash +# This file was generated on 2022-01-10T22:24:10+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 26523a607b..2facf79a66 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:52+01:00 from the rspec-dev repo. +# This file was generated on 2022-01-10T22:24:10+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