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) #2788

Closed
wants to merge 7 commits 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
28 changes: 25 additions & 3 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-16T22:10:29+00:00 from the rspec-dev repo.
# This file was generated on 2020-11-29T14:01:14+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 All @@ -11,6 +11,8 @@ on:
pull_request:
branches:
- '*'
env:
RSPEC_CI: true
jobs:
test:
name: Ruby ${{ matrix.ruby }}
Expand All @@ -24,8 +26,6 @@ jobs:
- 2.5
- 2.4
- 2.3
- 2.2
- 2.1.9
- ruby-head
fail-fast: false
continue-on-error: ${{ matrix.ruby == 'jruby-9.2.13.0' || endsWith(matrix.ruby, 'head') }}
Expand All @@ -40,3 +40,25 @@ jobs:
- run: script/clone_all_rspec_repos
- run: bundle install --binstubs --standalone
- run: script/run_build

windows:
name: Ruby ${{ matrix.ruby }} (Windows)
runs-on: windows-latest
strategy:
matrix:
ruby:
- 2.7
- 2.6
- 2.5
- 2.4
- 2.3
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
bundler: 2
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- run: cinst ansicon
- run: bundle exec rspec --backtrace
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-16T22:10:29+00:00 from the rspec-dev repo.
# This file was generated on 2020-11-29T14:01:14+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
20 changes: 1 addition & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This file was generated on 2020-11-16T22:10:29+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.

# In order to install old Rubies, we need to use old Ubuntu distibution.
dist: trusty
language: ruby
Expand All @@ -15,29 +12,14 @@ before_install:
bundler_args: "--binstubs --standalone --without documentation --path ../bundle"
script: "script/run_build"
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
- ree
- rbx-3
- jruby-9.1.7.0 # pin JRuby to this until travis/rvm can install later versions
- jruby-head
- jruby-1.7
env:
- JRUBY_OPTS='--dev'
- RSPEC_CI='true'
matrix:
include:
- rvm: jruby-1.7
env: JRUBY_OPTS='--dev --1.8'
- rvm: 2.7.1
env: DIFF_LCS_VERSION="~> 1.3.0"
- rvm: 2.7.1
env: DIFF_LCS_VERSION="1.4.3"
allow_failures:
- rvm: jruby-head
- rvm: ruby-head
- rvm: rbx-3
fast_finish: true
branches:
only:
Expand Down
42 changes: 0 additions & 42 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion lib/rspec/core/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Core
# Version information for RSpec Core.
module Version
# Current version of RSpec Core, in semantic versioning format.
STRING = '3.11.0.pre'
STRING = '4.0.0.pre'
end
end
end
2 changes: 1 addition & 1 deletion maintenance-branch
Original file line number Diff line number Diff line change
@@ -1 +1 @@
main
4-0-dev
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-16T22:10:29+00:00 from the rspec-dev repo.
# This file was generated on 2020-11-29T14:01:14+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
9 changes: 3 additions & 6 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-16T22:10:29+00:00 from the rspec-dev repo.
# This file was generated on 2020-11-29T14:01:14+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 @@ -12,11 +12,8 @@ if is_mri; then
clone_repo "rspec-core"
clone_repo "rspec-expectations"
clone_repo "rspec-mocks"
clone_repo "rspec-rails"

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

popd
else
Expand Down
26 changes: 12 additions & 14 deletions script/functions.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file was generated on 2020-11-16T22:10:29+00:00 from the rspec-dev repo.
# This file was generated on 2020-11-29T14:01:14+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.

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
Expand All @@ -12,14 +12,20 @@ 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

function clone_repo {
if [ ! -d $1 ]; then # don't clone if the dir is already there
travis_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch $MAINTENANCE_BRANCH"
if [ -z "$2" ]; then
BRANCH_TO_CLONE="$MAINTENANCE_BRANCH"
else
BRANCH_TO_CLONE="$2"
fi

travis_retry eval "git clone https://github.com/rspec/$1 --depth 1 --branch $BRANCH_TO_CLONE"
fi;
}

Expand Down Expand Up @@ -47,12 +53,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 @@ -187,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-16T22:10:29+00:00 from the rspec-dev repo.
# This file was generated on 2020-11-29T14:01:14+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-16T22:10:29+00:00 from the rspec-dev repo.
# This file was generated on 2020-11-29T14:01:14+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-16T22:10:29+00:00 from the rspec-dev repo.
# This file was generated on 2020-11-29T14:01:14+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
4 changes: 0 additions & 4 deletions spec/integration/bisect_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ module RSpec::Core
RSpec.describe "Bisect", :slow, :simulate_shell_allowing_unquoted_ids do
include FormatterSupport

before do
skip "These specs do not consistently pass or fail on AppVeyor on Ruby 2.1+"
end if ENV['APPVEYOR'] && RUBY_VERSION.to_f > 2.0

def bisect(cli_args, expected_status=nil)
options = ConfigurationOptions.new(cli_args)

Expand Down
7 changes: 3 additions & 4 deletions spec/rspec/core/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -535,9 +535,7 @@ def stub_expectation_adapters
expect(config.files_to_run).to contain_files("./spec/rspec/core/resources/a_spec.rb")
end

it "supports absolute path patterns", :failing_on_appveyor,
:pending => false,
:skip => (ENV['APPVEYOR'] ? "Failing on AppVeyor but :pending isn't working for some reason" : false) do
it "supports absolute path patterns" do
dir = File.expand_path("../resources", __FILE__)
config.pattern = File.join(dir, "**/*_spec.rb")
assign_files_or_directories_to_run "spec"
Expand Down Expand Up @@ -618,7 +616,8 @@ def stub_expectation_adapters
expect(config.files_to_run).to contain_files("C:/path/to/project/spec/sub/foo_spec.rb")
end

it "loads files in Windows when directory is specified", :failing_on_appveyor, :if => RSpec::Support::OS.windows? do
it "loads files in Windows when directory is specified", :if => RSpec::Support::OS.windows? do
pending "Fails for some reason yet to be discovered"
assign_files_or_directories_to_run "spec\\rspec\\core\\resources"
expect(config.files_to_run).to contain_files("spec/rspec/core/resources/a_spec.rb")
end
Expand Down
Loading