Skip to content

Commit

Permalink
Move MRI build to Github Actions
Browse files Browse the repository at this point in the history
jruby not moved because there is too many issues with it at the moment.

Next step fix :
- fix ruby 3
- fix flacky test with "mountable_engine?" error
- add JRuby
  • Loading branch information
benoittgt committed Nov 18, 2020
1 parent f057558 commit e6bfef7
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 56 deletions.
101 changes: 101 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
name: RSpec CI
on:
push:
branches:
- 'main'
- '*-maintenance'
- '*-dev'
- 'github-actions' # to remove
pull_request:
branches:
- '*'
jobs:
test:
name: 'Ruby: ${{ matrix.ruby }}, Rails: ${{ matrix.env.RAILS_VERSION }}'
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
include:
# Rails 6.0 builds >= 2.5.0
- ruby: 3.0.0-preview1
allow_failure: true
env:
RAILS_VERSION: '~> 6.0.0'
- ruby: 2.7
env:
RAILS_VERSION: '~> 6.0.0'
- ruby: 2.6
env:
RAILS_VERSION: '~> 6.0.0'
- ruby: 2.5
env:
RAILS_VERSION: '~> 6.0.0'
# Rails 5.2 builds >= 2.2.2
- ruby: 2.6.6
env:
RAILS_VERSION: '~> 5.2.0'
- ruby: 2.5.8
env:
RAILS_VERSION: '~> 5.2.0'
- ruby: 2.4.10
env:
RAILS_VERSION: '~> 5.2.0'
- ruby: 2.3.8
env:
RAILS_VERSION: '~> 5.2.0'
- ruby: 2.2.10
allow_failure: true
env:
RAILS_VERSION: '~> 5.2.0'
- ruby: 2.2.10
env:
RAILS_VERSION: '5-2-stable'

# Rails 5.1 Builds >= 2.2.2
- ruby: 2.6.6
env:
RAILS_VERSION: '~> 5.1.0'
- ruby: 2.5.8
env:
RAILS_VERSION: '~> 5.1.0'
- ruby: 2.4.10
env:
RAILS_VERSION: '~> 5.1.0'
- ruby: 2.3.8
env:
RAILS_VERSION: '~> 5.1.0'
- ruby: 2.2.10
env:
RAILS_VERSION: '~> 5.1.0'

# Rails 5.0 Builds >= 2.2.2
- ruby: 2.6.6
env:
RAILS_VERSION: '~> 5.0.0'
- ruby: 2.5.8
env:
RAILS_VERSION: '~> 5.0.0'
- ruby: 2.4.10
env:
RAILS_VERSION: '~> 5.0.0'
- ruby: 2.3.8
env:
RAILS_VERSION: '~> 5.0.0'
- ruby: 2.2.10
env:
RAILS_VERSION: '~> 5.0.0'
continue-on-error: ${{ endsWith(matrix.ruby, 'head') }}
steps:
- uses: actions/checkout@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: false
- run: script/update_rubygems_and_install_bundler
continue-on-error: ${{ matrix.allow_failure }}
- run: script/clone_all_rspec_repos
continue-on-error: ${{ matrix.allow_failure }}
- run: bundle install --binstubs && script/run_build
env: ${{ matrix.env }}
continue-on-error: ${{ matrix.allow_failure }}
53 changes: 5 additions & 48 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,66 +38,23 @@ script: "script/run_build 2>&1"

matrix:
include:
# Rails 6.0 builds >= 2.5.0
- rvm: jruby-head
jdk: oraclejdk11
env:
- RAILS_VERSION='~> 6.0.0'
- JRUBY_OPT=--dev
- JAVA_OPTS="--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens java.base/java.io=org.jruby.dist --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED"
- rvm: ruby-3.0.0-preview1
env: RAILS_VERSION='~> 6.0.0'
allow_failure: true
- rvm: 2.7.1
env: RAILS_VERSION='~> 6.0.0'
- rvm: 2.6.6
env: RAILS_VERSION='~> 6.0.0'
- rvm: 2.5.8
env: RAILS_VERSION='~> 6.0.0'

# Rails 5.2 builds >= 2.2.2
- rvm: jruby-head
jdk: oraclejdk11
env:
- RAILS_VERSION='~> 5.2.0'
- JRUBY_OPT=--dev
- JAVA_OPTS="--add-opens java.base/sun.nio.ch=org.jruby.dist --add-opens java.base/java.io=org.jruby.dist --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.security.cert=ALL-UNNAMED --add-opens=java.base/java.util.zip=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.util.regex=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/javax.crypto=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED"
- rvm: 2.6.6
env: RAILS_VERSION='~> 5.2.0'
- rvm: 2.5.8
env: RAILS_VERSION='~> 5.2.0'
- rvm: 2.4.10
env: RAILS_VERSION='~> 5.2.0'
- rvm: 2.3.8
env: RAILS_VERSION='~> 5.2.0'
- rvm: 2.2.10
env: RAILS_VERSION='~> 5.2.0'
allow_failure: true
- rvm: 2.2.10
env: RAILS_VERSION='5-2-stable'

# Rails 5.1 Builds >= 2.2.2
- rvm: 2.6.6
env: RAILS_VERSION='~> 5.1.0'
- rvm: 2.5.8
env: RAILS_VERSION='~> 5.1.0'
- rvm: 2.4.10
env: RAILS_VERSION='~> 5.1.0'
- rvm: 2.3.8
env: RAILS_VERSION='~> 5.1.0'
- rvm: 2.2.10
env: RAILS_VERSION='~> 5.1.0'

# Rails 5.0 Builds >= 2.2.2
- rvm: 2.6.6
env: RAILS_VERSION='~> 5.0.0'
- rvm: 2.5.8
env: RAILS_VERSION='~> 5.0.0'
- rvm: 2.4.10
env: RAILS_VERSION='~> 5.0.0'
- rvm: 2.3.8
env: RAILS_VERSION='~> 5.0.0'
- rvm: 2.2.10
env: RAILS_VERSION='~> 5.0.0'

fast_finish: true

branches:
only:
- master
- /^\d+-\d+-maintenance$/
6 changes: 0 additions & 6 deletions script/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,6 @@ export JRUBY_OPTS=${JRUBY_OPTS:-"--server -Xcompile.invokedynamic=false"}
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; 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"
Expand Down
5 changes: 3 additions & 2 deletions spec/rspec/rails/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def self.application; end
expect(example).to be_a(RSpec::Rails::FeatureExampleGroup)
end

if defined?(ActionMailer)
if RSpec::Rails::FeatureCheck.has_action_mailer?
it "metadata `type: :mailer` sets up mailer example groups" do
a_mailer_class = Class.new
stub_const "SomeMailer", a_mailer_class
Expand All @@ -265,7 +265,8 @@ def self.application; end
expect(group.new).to be_a(RSpec::Rails::MailerExampleGroup)
end

describe 'clears ActionMailer::Base::Deliveries after each example' do
# JRuby give us a uninitialized constant Mail::AddressList::Address on Github Actions
describe 'clears ActionMailer::Base::Deliveries after each example', skip: RSpec::Support::Ruby.jruby? do
let(:mailer) do
Class.new(ActionMailer::Base) do
default from: 'from@example.com'
Expand Down

0 comments on commit e6bfef7

Please # to comment.