Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Updated ci build scripts (from rspec-dev) #444

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo.
# This file was generated on 2020-12-07T01:07:10+03: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
Expand Down Expand Up @@ -26,8 +26,6 @@ jobs:
- 2.5
- 2.4
- 2.3
- 2.2
- 2.1.9
- ruby-head
env:
-
Expand Down Expand Up @@ -74,8 +72,6 @@ jobs:
- 2.5
- 2.4
- 2.3
- 2.2
- 2.1.9
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion .rubocop_rspec_base.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo.
# This file was generated on 2020-12-07T01:07:10+03: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
Expand Down
35 changes: 0 additions & 35 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion script/ci_functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo.
# This file was generated on 2020-12-07T01:07:10+03: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:
Expand Down
7 changes: 2 additions & 5 deletions script/clone_all_rspec_repos
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo.
# This file was generated on 2020-12-07T01:07:10+03: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
Expand All @@ -13,10 +13,7 @@ if is_mri; then
clone_repo "rspec-expectations"
clone_repo "rspec-mocks"
clone_repo "rspec-rails" "main"

if rspec_support_compatible; then
clone_repo "rspec-support"
fi
clone_repo "rspec-support"

popd
else
Expand Down
24 changes: 8 additions & 16 deletions script/functions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This file was generated on 2020-11-22T07:41:13+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 )"
source $SCRIPT_DIR/ci_functions.sh
source $SCRIPT_DIR/predicate_functions.sh
Expand All @@ -12,8 +9,8 @@ SPECS_HAVE_RUN_FILE=specs.out
MAINTENANCE_BRANCH=`cat maintenance-branch`

# Don't allow rubygems to pollute what's loaded. Also, things boot faster
# without the extra load time of rubygems. Only works on MRI Ruby 1.9+
if is_mri_192_plus; then
# without the extra load time of rubygems. Only works on MRI.
if is_mri; then
export RUBYOPT="--disable=gem"
fi

Expand Down Expand Up @@ -53,12 +50,7 @@ function run_cukes {

echo "${PWD}/bin/cucumber"

if is_mri_192; then
# For some reason we get SystemStackError on 1.9.2 when using
# the bin/cucumber approach below. That approach is faster
# (as it avoids the bundler tax), so we use it on rubies where we can.
bundle exec cucumber --strict
elif is_jruby; then
if is_jruby; then
# For some reason JRuby doesn't like our improved bundler setup
RUBYOPT="-I${PWD}/../bundle -rbundler/setup" \
PATH="${PWD}/bin:$PATH" \
Expand Down Expand Up @@ -88,8 +80,11 @@ function run_spec_suite_for {
echo "Running specs for $1"
pushd ../$1
unset BUNDLE_GEMFILE
bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"`
bundle_install_flags="--binstubs --standalone --without documentation --path ../bundle"
travis_retry eval "(unset RUBYOPT; exec bundle install $bundle_install_flags)"
if [ $1 == rspec-rails ]; then
unset RUBYOPT
fi;
run_specs_and_record_done
popd
else
Expand Down Expand Up @@ -193,11 +188,8 @@ function run_all_spec_suites {
fold "rspec-core specs" run_spec_suite_for "rspec-core"
fold "rspec-expectations specs" run_spec_suite_for "rspec-expectations"
fold "rspec-mocks specs" run_spec_suite_for "rspec-mocks"
fold "rspec-support specs" run_spec_suite_for "rspec-support"
if rspec_rails_compatible; then
fold "rspec-rails specs" run_spec_suite_for "rspec-rails"
fi

if rspec_support_compatible; then
fold "rspec-support specs" run_spec_suite_for "rspec-support"
fi
}
66 changes: 6 additions & 60 deletions script/predicate_functions.sh
Original file line number Diff line number Diff line change
@@ -1,70 +1,24 @@
# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo.
# This file was generated on 2020-12-07T01:07:10+03: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 {
if ruby -e "exit(!defined?(RUBY_ENGINE) || RUBY_ENGINE == 'ruby')"; then
# RUBY_ENGINE only returns 'ruby' on MRI.
# MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode)
# RUBY_ENGINE only returns 'ruby' on MRI.
if ruby -e "exit(RUBY_ENGINE == 'ruby')"; then
return 0
else
return 1
fi;
}

function is_jruby {
if ruby -e "exit(defined?(RUBY_PLATFORM) && RUBY_PLATFORM == 'java')"; then
# RUBY_ENGINE only returns 'ruby' on MRI.
# MRI 1.8.7 lacks the constant but all other rubies have it (including JRuby in 1.8 mode)
# RUBY_PLATFORM only returns 'java' on JRuby.
if ruby -e "exit(RUBY_PLATFORM == 'java')"; then
return 0
else
return 1
fi;
}

function is_mri_192 {
if is_mri; then
if ruby -e "exit(RUBY_VERSION == '1.9.2')"; then
return 0
else
return 1
fi
else
return 1
fi
}

function is_mri_192_plus {
if is_mri; then
if ruby -e "exit(RUBY_VERSION.to_f > 1.8)"; then
return 0
else
return 1
fi
else
return 1
fi
}

function is_mri_2plus {
if is_mri; then
if ruby -e "exit(RUBY_VERSION.to_f > 2.0)"; then
return 0
else
return 1
fi
else
return 1
fi
}

function is_ruby_23_plus {
if ruby -e "exit(RUBY_VERSION.to_f >= 2.3)"; then
return 0
else
return 1
fi
}

function is_ruby_25_plus {
if ruby -e "exit(RUBY_VERSION.to_f >= 2.5)"; then
return 0
Expand All @@ -81,22 +35,14 @@ function rspec_rails_compatible {
fi
}

function rspec_support_compatible {
if [ "$MAINTENANCE_BRANCH" != "2-99-maintenance" ] && [ "$MAINTENANCE_BRANCH" != "2-14-maintenance" ]; then
return 0
else
return 1
fi
}

function additional_specs_available {
type run_additional_specs > /dev/null 2>&1
return $?
}

function documentation_enforced {
if [ -x ./bin/yard ]; then
if is_mri_2plus; then
if is_mri; then
return 0
else
return 1
Expand Down
2 changes: 1 addition & 1 deletion script/run_build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo.
# This file was generated on 2020-12-07T01:07:10+03: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
Expand Down
12 changes: 3 additions & 9 deletions script/update_rubygems_and_install_bundler
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
#!/bin/bash
# This file was generated on 2020-11-22T07:41:13+00:00 from the rspec-dev repo.
# This file was generated on 2020-12-07T01:07:10+03: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

if is_ruby_23_plus; then
yes | gem update --system
yes | gem install bundler
else
echo "Warning installing older versions of Rubygems / Bundler"
gem update --system '2.7.8'
gem install bundler -v '1.17.3'
fi
yes | gem update --system
yes | gem install bundler